- This topic is empty.
July 4, 2014 at 9:34 am #174601
I’m working on a site, where I want a large banner image at the top of the screen, (where I’m trying to use the (external) CSS background-image to make it work.
(I plan to use the CSS img protocol to subsequently add other images on top of the banner later, using absolute positions.)
I also plan to have multiple (external) CSS files to cover the different screen resolutions used by different device types.
The htm file, external css file and image are all currently in the same folder.
I’m using a smaller image called ‘tester.png’ to see if I can make this work.
Unfortunately the background image just never appears which is really grinding my gears at the moment. Any help would be great. (I’m wondering if the page is loading the image off the side of the screen.)
(I’m using a screen with the resolution at 1,920x 1,080 where the browser width is 1536 pixels.)
Here’s the very simple HTML :
<link rel=”stylesheet” media=”(min-width: 1200px)” href=”desktop.css” />
p class = “bannerimg”
(I know there’s a < missing … but it won’t let me enter the line otherwise)
Here’s the CSS code in desktop.css :
”’background-position: 200px 20px;”’
Andy.July 4, 2014 at 9:58 am #174606
At the moment, all of these files are still on my c: drive.. so I can’t really send you a link unfortunately (which in hindsite might have been a smarter thing to have done).
At the moment all I get is a blank white screen on the browser (Firefox 30.0).
I get the below message in the console inspector.
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol._
However, (given that I’d declared at the start of the htm file “<!DOCTYPE html>” (as usual), I don’t understand why the browser is unclear that the encoding is in HTML.(?)
C99July 4, 2014 at 10:22 am #174609
Here’s the Index.htm :
(https://gist.github.com/anonymous/9f42f684af9469513796#file-index-htm “Index.htm External CSS Background Image Test”)
Here’s the External CSS File contents of Desktop.css :
(https://gist.github.com/anonymous/9f42f684af9469513796#file-bannercsstester” title=”External CSS Background Image – CSS File”)
- The forum ‘CSS’ is closed to new topics and replies.