...

View Full Version : External CSS problems



galt
07-24-2012, 04:44 AM
alright... shop.html and shopstyle.css are in the same folder, along with /images folder

I get absolutely no images showing up or borders or anything!!! (and yes, I have checked the images are indeed .jpgs)

shop.html:


<!DOCTYPE html>
<html>
<head>
<title>Shop</title>
<link rel="stylesheet" type="text/css" href="shopstyle.css"> <!--reference the stylesheet-->
</head>
<body>
<img src = "/images/hotday.jpg" alt = "" class = "shirtpadding"/>
<img src = "/images/smokeout.jpg" alt = "" class = "shirtpadding"/>
</body>
</html>


shopstyle.css:


.shirtpadding {
padding: 10% 10% 10% 10%;
border:#d93d3d dashed 20 px;//red border style
}


also, i'm a bit of a newbie, anyone have opinions on good html editors? I really like the one on codeacademy that puts in the [ICODE]</whateveryoutype> as soon as you type the [ICODE]<whateveryoutype> (same for the ""). also, is there such thing as an html compiler???

sean3838
07-24-2012, 04:55 AM
Just have your shop.html in your root folder, create a folder called css and put the shopstyle.css in that. Then you obviously have your images folder with your images in it.

Then use this:



<!DOCTYPE html>
<html>
<head>
<title>Shop</title>
<link rel="stylesheet" type="text/css" href="css/shopstyle.css"> <!--reference the stylesheet-->
</head>
<body>
<img src = "images/hotday.jpg" alt = "" class = "shirtpadding"/>
<img src = "images/smokeout.jpg" alt = "" class = "shirtpadding"/>
</body>
</html>

tracknut
07-24-2012, 04:58 AM
<img src = "/images/hotday.jpg" alt = "" class = "shirtpadding"/>


This directory path is from the top of your site, ie a folder "images" at the top of your site. Is that where it is?



border:#d93d3d dashed 20 px;//red border style


CSS comments look like /* .... */

Dave

galt
07-24-2012, 05:06 AM
thanks... i realized it was because i was using notepad++ and just trying to run it right from there... even after i made your changes it still wasn't working... guess notepad++ can't make file associations?

put it up through filezilla on the actual server and it works like a charm.

sean3838
07-24-2012, 05:12 AM
If your directory is set up right it should still run from notepad++ Just double check everything is set up correctly. I got your code to run from notepad++


thanks... i realized it was because i was using notepad++ and just trying to run it right from there... even after i made your changes it still wasn't working... guess notepad++ can't make file associations?

put it up through filezilla on the actual server and it works like a charm.

galt
07-24-2012, 05:34 AM
thanks for all the help guys... but that red border still isn't showing up.... i know its linking correctly because now i've put a <p> indicator in, but that .shirtpadding isn't working. do you see anything wrong with how I call it in the img tag?

a noob in need of help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum