Jump to content

Font And Image Problems


meranda2100

Recommended Posts

I am having problems with background images and fonts appearing in my page. I have the images saved in the same folder as my index page and on the same server as my home page, but the only page of my css that displays in my homepage is the background color for the body. The images work when I just put them in with html, but I want to have them repeat with css and I want to know what I am doing wrong. Here is my code for css and a link:body{background-color:#1E90FF}h1,h2,h3{font-family:Georgia;font-color:#B22222}#container{width:100%;margin:0;padding:0}#header{width:100%;background-image:url('http://recyclevinyl.comze.com/music%20image.jpg')}#content p{text-align:center;font-family:Andalus}#footer{background-image:url('http//recyclevinyl.comze.com/records%202.jpg')}http://www.recyclevinyl.comze.com(Norton says the site is unsafe, it is not, I am working on getting the rating changed.)Thanks, any help with be appreciated.Meranda 2100

Link to comment
Share on other sites

well, as far as your font-color, that's because to set the color of text, all you need to use is font: #b22222.As far as the images go, have you tried double checking the spelling? My guess is maybe you may need underscore _ instead of %20. Check your naming convention.

Link to comment
Share on other sites

on a side note, its always worth putting your site through this every once in a while if things aren't going right. And consider using a strict doctype. I did notice by looking at your source code you are using self-closing tags, which is a practice reserved for XHTML documents, and thus will cause errors in the browsers "eye" when using an HTML DTD.

Link to comment
Share on other sites

well, as far as your font-color, that's because to set the color of text, all you need to use is font: #b22222.As far as the images go, have you tried double checking the spelling? My guess is maybe you may need underscore _ instead of %20. Check your naming convention.
Actually, using font: #b22222 is going to do nothing whatsoever. There is no font property that uses hexadecimal code. If you want to give color to your text, you use the color property.I recommend against shorthand coding, especially for font properties, unless you know what you're doing. By writing font: You're resetting all the properties to their default before writing the new ones.It means that you you write
font-size: 4em;font: Arial;

You might come across the surprise that your font is not actually 4em.I've seen people who also wonder why their background color disappears when they use the shorthand background property to add an image afterwards.

Link to comment
Share on other sites

Actually, using font: #b22222 is going to do nothing whatsoever. There is no font property that uses hexadecimal code. If you want to give color to your text, you use the color property.I recommend against shorthand coding, especially for font properties, unless you know what you're doing. By writing font: You're resetting all the properties to their default before writing the new ones.It means that you you write
font-size: 4em;font: Arial;

You might come across the surprise that your font is not actually 4em.I've seen people who also wonder why their background color disappears when they use the shorthand background property to add an image afterwards.

wow, im absolutely retarded. Yeah, I meant to write color: #........ yikes! sorry about the confusion. I'm sick, i must have mixed up which part he was supposed to drop.how embarrassing! :)
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the suggestions, I changed the doctype to strict and tried to change use the _ for the images, but the my images will still not appear as background images. I have built most of the site with html, but I would really like two images to repeat behind the text, in the header and the footer. The easiest way to do this is CSS. I have had this work on other sites before, I don't know why it is not working now.This is my only CSS:#header{width:100%;background-image:url('http://recyclevinyl.site90.com/music_20images.jpg')}#footer{background-image:url('http://recyclevinyl.site90.com/records_202.jpg')}This is my site address: www.recyclevinyl.site90.comI would really appreciate any help.Meranda 2100

Link to comment
Share on other sites

Rather than an underscore, it should be %20.http://recyclevinyl.site90.com/music%20images.jpghttp://recyclevinyl.site90.com/records%202.jpgYou could also try leaving a space there.'http://recyclevinyl.site90.com/music images.jpg''http://recyclevinyl.site90.com/records 2.jpg'

Link to comment
Share on other sites

Rather than an underscore, it should be %20.http://recyclevinyl.site90.com/music%20images.jpghttp://recyclevinyl.site90.com/records%202.jpgYou could also try leaving a space there.'http://recyclevinyl.site90.com/music images.jpg''http://recyclevinyl.site90.com/records 2.jpg'
I was able to use the % and put the style sheet in the same folder as my index.html file and was able to get the background image to work. Thanks! (I just did not like how it looked so I just added images in html and centered them above the text.) Thanks again. Have a good day!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...