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 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Help! Lost money: CSS web design for dummies

    Hi guys just purchased the book mentioned in the title.
    Basically im going through the example and my chosen text editor is sublime text 2. My problem is that this stupid book cost me 22.00 and it is wrong. Even the basics and foundations of the book is wrong, well i hope it isn't anyway.... thsi is where you guys come in. So it tell me to go though an example where if i type the following into my chosen text editor and save it as a htm then it should display the obvious that is stated....

    This is the code:

    Code:
    <html>
      <head>
            <style>
                 h1 { font-size:16pt color:blue;}
           </style>
      </head>
    <body>
             <h1>this headline is blue and 16 pt.</h1>
    </body>
    </html>
    When i did this the text was black and not in 16pt... then the next example i used was to paste this and save it as .htm so i did... the following code:

    Code:
    <html>
    <head>
    <style>
    div.box {width: 300px; height: 200px; padding: 30px;
    font: 46pt times new roman;}
    </style>
    </head>
    <body>
    <div class=”box” style=” filter:
    progid:DXImageTransform.Microsoft.Alpha
    (Opacity=100,
    FinishOpacity=0, Style=1, StartX=0, FinishX=0, StartY=0,
    FinishY=100)”>
    Hey...you can modify opacity.</div>
    </body>
    </html>
    and it did not display the text with its opacity adjusted from 0 to 100.

    What the hell is going on this book is 2005 and is still being sold. Dont computer understand this code/ language anymore???

    P.s. i also tried other text editors such as notepad and notepad++

    Help would be appreciated.

    thank you

  • #2
    New Coder
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    sorry guys tried to make the code look better for your ease

  • #3
    New Coder
    Join Date
    Feb 2010
    Location
    North Carolina
    Posts
    71
    Thanks
    26
    Thanked 1 Time in 1 Post
    In your first example, you didn't close the font-size style. It should look like this:

    Code:
    h1 { font-size:16pt; color:blue;}

  • Users who have thanked JJackson for this post:

    araah (06-10-2012)

  • #4
    New Coder
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yes that works... but why the hell doesnt an education book have this that is still in production for 22.00 why would it make mistake right from the very start???

    this is actually very annoying

  • #5
    New Coder
    Join Date
    Feb 2010
    Location
    North Carolina
    Posts
    71
    Thanks
    26
    Thanked 1 Time in 1 Post
    Quote Originally Posted by araah View Post
    yes that works... but why the hell doesnt an education book have this that is still in production for 22.00 why would it make mistake right from the very start???

    this is actually very annoying
    I've actually never used a book so I wouldn't know a lot about them. But I personally find it easier to put your CSS inside its own file for cleanliness. Also, comparing your code to similar sites helps a whole lot in identifying mistakes.

  • #6
    New Coder
    Join Date
    Jun 2012
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JJackson View Post
    I've actually never used a book so I wouldn't know a lot about them. But I personally find it easier to put your CSS inside its own file for cleanliness. Also, comparing your code to similar sites helps a whole lot in identifying mistakes.
    could you tell me how to link a style sheet to the htm file? Do i have to keep referring back to the css file everytime i use a variable?

  • #7
    New Coder
    Join Date
    Feb 2010
    Location
    North Carolina
    Posts
    71
    Thanks
    26
    Thanked 1 Time in 1 Post
    Quote Originally Posted by araah View Post
    could you tell me how to link a style sheet to the htm file? Do i have to keep referring back to the css file everytime i use a variable?
    Just create a separate file called style.css (css would be the extension you can choose from the filetype when saving) and put this in the <head> tags of your index.html:

    <link rel="stylesheet" type="text/css" href="style.css" />

    You won't have to keep referring to it.

  • #8
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    On a side note: The first line in an HTML document should always be the document type declaration. You don’t yet have to understand what exactly that does, suffice it to say that it should always be there and always the first thing in your document. Below is an example for linking external stylesheets (and using a doctype):
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
      <head>
            <link rel="stylesheet" type="text/css" href="example.css" media="screen">
      </head>
    <body>
             <h1>this headline is blue and 16 pt.</h1>
    </body>
    </html>
    The file path to the stylesheet assumes the file on the same level in the hierarchy as the HTML file.


  •  

    Posting Permissions

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