Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    16
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Angry External CSS problems

    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:
    Code:
    <!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:
    Code:
    .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???

  • #2
    New Coder
    Join Date
    Jan 2012
    Posts
    97
    Thanks
    1
    Thanked 13 Times in 13 Posts
    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:

    Code:
    <!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>

  • Users who have thanked sean3838 for this post:

    galt (07-24-2012)

  • #3
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,297
    Thanks
    10
    Thanked 282 Times in 281 Posts
    Quote Originally Posted by galt View Post
    <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

  • #4
    New Coder
    Join Date
    Jul 2012
    Posts
    16
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Cool

    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.

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    97
    Thanks
    1
    Thanked 13 Times in 13 Posts
    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++

    Quote Originally Posted by galt View Post
    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.

  • Users who have thanked sean3838 for this post:

    galt (07-24-2012)

  • #6
    New Coder
    Join Date
    Jul 2012
    Posts
    16
    Thanks
    10
    Thanked 0 Times in 0 Posts
    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


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •