CSS and images on Master Page
best to use:
<link href="<%=ResolveUrl("~/css/style.css") %>" rel="stylesheet" type="text/css />
since this will cope with iis application roots unlike:
<link href="/css/style.css" rel="stylesheet" type="text/css />
How to add Background Image in css using master page
Like Kartikeya and Neophyte said in the comments, this case might just be about the incorrect path you've set your background image to be searched for.
Try the
background-image: url(../images/image.jpg);
or place your image to the same folder where your html file is located, then try it. This way you can at least figure out if it's the path that's wrong here.
Images not loaded from master page in directory
@Brendan Hannemann show me a link that where is expaint. The code i must use is:
<img src="<%=ResolveUrl("~/afbeeldingen/berichten.png") %>" alt="nieuwe berichten" id="berichten" />
Setting background image in asp.net (Master page)
This largely depends on where your css file is located. If it is located in the same folder where the 'image' folder is located, then this looks correct. However, if you css file is in a different directory (say /css) then your link in your css file will not work. Instead, either change the css link to point to a complete link:
background-image: url('http://mysite.com/images/background.jpg)
I am unsure if the '~' link will work in a stylesheet. Since your css is in the scripts folder, you should be able to do this:
background-image: url('../images/background.jpg')
img size in master page changing img size in default page
The img css caused the error due to img css changes any img in the project and in order to settle that the code of img in css must specify the container exactly.
Old code:
img {
border-style: none;
border-color: inherit;
border-width: 0;
height: 70px;
width: 200px;
New code :
.container1 .img {
border-style: none;
border-color: inherit;
border-width: 0;
width: 540px;
height:400px;
}
ASP.NET CSS file in master page
<link href="~/default.css" rel="stylesheet" type="text/css" />
Related Topics
Radio Buttons Show Unwanted White Background in Chrome. Firefox Is Fine
Working with CSS Floats in HTML2Pdf
CSSmin Not Correctly Handling @Import
Difference Between Initial Containing Block and Viewport
Should I Locally Store CSS Generated by The Google Web Fonts API
How to Make Bootstrap 4 Carousel Images Responsive
How to Apply Text-Align Left in The First Column and Text-Align Right in The Others
How to Prevent CSS Declaration Dropped Errors Cross Browser
How to Show Md-Toast with Background Color
Center Text Larger Than Container? (Without Using Separate Child Element)
Div Elements to Follow a Curved Path with CSS3
CSS Selector for Multiple Sub-Elements
Why Are My Google Web Fonts Pixelated
How to Customize Responsive Columns and Inputs Fields in Twitter Bootstrap