#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    16
    Rep Power
    0

    Angry "i Do Not Understand How Css Works With Html."


    The problem here is, "I DO NOT UNDERSTAND HOW CSS WORKS WITH HTML."

    I looked over WebMonkey and while it shows you were to embed it. It doesn't explain how it works with an existing HTML page with tables.

    To apply a .css stylesheet ("style.css" in the example below) to an HTML page, a <link> tag is added to the page header:

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


    Am I not getting my point across?

    Why can't anyone explain that to me?
    Last edited by jallard; August 21st, 2003 at 02:18 PM.
  2. #2
  3. Another Vagabond Using Knoppix
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    73
    Rep Power
    13
    Normally, Stylesheet should work unless target file is not correct. u can also type
    Code:
    <head>
    <style>
    /*copy your stylesheet content here */
    </style>
    </head>
    Last edited by Swobodin; August 22nd, 2003 at 02:38 AM.
  4. #3
  5. No Profile Picture
    Average Intelligence
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Ohio/Chicago
    Posts
    678
    Rep Power
    12
    are you confused on how since it's not an 'inlined' css you don't understand how all objects inherit the porperties the css gives to the page?

    well you understand the inlined css right? when you do a css stylesheet include like that, even though it doesn't appear in the tags (except the class), they're assumed to be there, it's passed onto all uhhh object i guess i'd call them on the page with the css listing.
    Last edited by unatratnag; August 21st, 2003 at 03:38 PM.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Quazar
    Posts
    207
    Rep Power
    13
    A style sheet can only been seen working if it's connected to an orginal html tag. That's the connection.

    Here's an example.
    in your styles.css file you have this.

    .regulartext {
    font-size: 10px;
    font-face: verdana;
    }

    ok. I hope you understand the styles end of it.

    now, this is what's in your html document (I'll give you 2 examples)

    example 1 - With tables
    PHP Code:
     <html>
    <
    head>
    <
    link rel="stylesheet" href="style.css" type="text/css"
    </
    head>
    <
    body>

    <
    table>
     <
    tr>
       <
    td class=regulartext>
          
    This text will be formatted the way you stated in your style sheet.
        </
    td>
      </
    tr>
    </
    table>

    </
    body>
    </
    html
    example 2. just text
    PHP Code:
     <html>
    <
    head>
    <
    link rel="stylesheet" href="style.css" type="text/css"
    </
    head>
    <
    body>
      
     <
    span class=regulartext>
    This text will be formatted the way you stated in your style sheet.
      </
    span>

    </
    body>
    </
    html

    Do you get it now?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    16
    Rep Power
    0

    Thumbs up Finally someone understood!


    I cannot say that I fully understand, because I don't. However, the code model is a tremendous help. Thank you ever so much. I really do appreciate your time and effort to help me understand.

    You Rule!!!!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Quazar
    Posts
    207
    Rep Power
    13
    Is there any particular part you need help with or don't understand?

    Basically, all you doing is setting attributes in another file and pulling them out whenever you need them?

    So say i was writing an example to show someone how css works. First I write a little bit explaining what I'm doing then I show the person what I just mentioned. Now, I don't want my example being in the same writing as my normal writing, soooooo I make it colour coded so it's easier to read. (I hope you see where I'm going with this). That is call done by Css.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    16
    Rep Power
    0
    Thanks I think I have it now.

IMN logo majestic logo threadwatch logo seochat tools logo