CSS Background Image Not Displaying
According to your CSS file path, I will suppose it is at the same directory with your HTML page, you have to change the url
as follows:
body { background: url(img/debut_dark.png) repeat 0 0; }
CSS: background-image: is not displaying my image (First time making a website and first time using stack overflow)
You shouldn't use the absolute path that's related to your computer, because it wont work elsewhere!
I think the problem comes from the use of \
in your paths. Try replacing them by '/'. I don't know exactly about your folders architecture but try something like this : images/aes.jpg
Issue with CSS background image (Image not Showing)
<a>
tag is an inline element and without a content will not show the background, so You need to make it display
as a block
or inline-block
element and then define the size of the element.
Try with:
.my-class {
display: block;
width: 128px;
height: 128px;
background: transparent url("../images/my-bg-image.png") no-repeat 0 center
}
For more information you can check the box model and the display property on the CSS 2.1 w3c standard.
Also the sections The width property and Computing widths and margins have an explanation of why the element doesn't show the background on an empty inline element.
Update:
Also the working draft of the CSS Box Model is available on the W3C site.
Update 2:
On a side note, relying only on a css background image for a link can have somme accessibility issues.
Related Topics
Equal Height Flexbox Columns in Chrome
Image Behavior Within Flexbox (Rows Embedded in Columns)
How to Set Different Colors in HTML in One Statement
CSS Vertically Align Floating Divs
Images in Svg Image Tags Not Showing Up in Chrome, But Displays Locally
Image Overlay on Responsive Sized Images Bootstrap
Text-Align Justify Not Working
Which Inline HTML Styles Does Github Markdown Accept
Wrapping Two Columns of Text Around an Image/Shape from Both Sides HTML CSS
Vertically Center Text in a 100% Height Div
Yet Another HTML/CSS Layout Challenge - Full Height Sidebar with Sticky Footer
Webpage Starts Zoomed in on Mobile Devices
Why Setting Absolutely Positioned Element's Sibling as Position:Relative, Brings It Above The Former
Website Response Time: Difference Between 'Load' and 'Finish'
How to Add a Title to a HTML Select Tag
How to Change an HTML Output of Wcf Service with My Own Content