Background image shows when referenced in HTML but not when referenced in CSS -


my css file in same directory html file, , background image file exists in images directory. shows if put directly body tag, not if reference in css file. directory structure root - images, html & css in root, picture in images.

html:

    <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title> title </title> <meta name="author" content="me"> <meta name="description" content="description."> <meta name="keywords" content="blah blah"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="style.css" type="text/css"> <link href='http://fonts.googleapis.com/css?family=playfair+display|lobster+two:700' rel='stylesheet' type='text/css'>  </head> <body> 

...and, of course, rest of file, finishing </body></html>.

css:

body {     padding: none;      margin: auto;     background: #ccc url("images/mainbg.jpg") repeat-x fixed top left, url("images/body-x2.png") repeat-x fixed bottom left; } 

get rid of background color declaration, #ccc, , make sure if have no content in <body> declare height of 100vh or that.

codepen example


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -