SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Basic question re CSS and HTML

    Hi,
    I am right at the beginning of my web design "career"! I am reading "Build you own Website the right way using HTML and CSS", and following the instructions to build a sample site. But something isn't quite right. I have 3 pages written in html, which look as they should with IE. But now I am adding a CSS page. I have this copied exactly from the book, and saved in the same file as the other 3 pages. I have put a link, again copied axactly from the book, into the 3 pages of HTML. I have checked the links and code several times. But the CSS instructions eg for Font and colour, are not being followed. The CSS page doesn't appear to be linked to the HTML pages. I have followed the instructions in the book, to "force Reload" the pages, to avoid caching problems, and it made no difference. Also the photo that I have tried to put into the HTml page isn't showing up, just a frame where it should be, even though it is also saved in the same file. I am doing all this offline. What am I doing wrong?
    Thanks

  2. #2
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be helpful to see your code. =)

  3. #3
    SitePoint Wizard Blake Tallos's Avatar
    Join Date
    Jun 2008
    Location
    Cuyahoga Falls, Ohio.
    Posts
    1,511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What i usually Do is use all my CSS Inline with my html untill i am ready to put it up on the Server.
    Its just easier that way. I can help you Much More if you Gave us a Link to See this example site.
    Or by posting the html & CSS in the thread.
    Blake Tallos - Software Engineer for Sanctuary
    Software Studio, Inc. C# - Fanatic!
    http://www.sancsoft.com/


  4. #4
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Auspom, Welcome to SitePoint!

    If we can see at least your html code, I'm quite sure we will find the error.
    Happy ADD/ADHD with Asperger's

  5. #5
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CSS code as follows:
    /*
    CSS for chocoholics anon
    /*
    body {
    font-family: Verdana, Helvetica, Arial, sans-serif;
    background-color: cc9966;
    padding: 15px;
    line-height: 125%;
    }



    HTML code :
    (Doctype etc missing as forum wouldn't let W3 links be posted)
    <head>
    <title>ChocaholicsAnon - Are you addicted to Chocolate?</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf - 8" />
    <link href="style1.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id= "header">
    <div id="sitebranding">
    <h1>ChocaholicsAnon - Are you addicted to Chocolate?</h1>
    </div>
    <div id="tagline">
    <p> Come and join us! A community with all Chocolate resources in one place.</p>
    </div>
    </div> <!-- end of header div-->
    <div id="navigation">
    <ul>
    (NAVIGATION REMOVE FOR FORUM PURPOSES)
    </ul>
    </div> <!-- end of navigation div -->
    <div id="bodycontent">
    <h2>Do you have a passion for Chocolate? </h2>
    <p><img src="Fotolia_6603249_XSpouringchoc.jpg" width ="283" height="424"
    alt="pouring melted chocolate" /></p>
    <p>At Chocaholicsanon you will not be alone. Here, you can buy a special gift, share a favourite chocolate recipe, or discover the history of chocolate. Want to know more about FairTrade chocolate? Then check out our Fair Trade page. Looking to join the 70% club? Read more about it here. Or do you just want a decent chocolate cake recipe? We have that too!</p>

    </div> <! -- end of bodycontent div -->



    </body>
    </html>
    Last edited by Auspom; Oct 23, 2008 at 00:58. Reason: typo

  6. #6
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no rule in your css that says that the color of the font should be changed.
    The only rule to change colors is the one for the background. Also for the color of your background you should add the # in front. (Just to follow standards)

    If you want to change the color of the font then you need to add the following css rule

    body { color:#99F600; }

    Hope it helps


Tags for this Thread

Bookmarks

Posting Permissions

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