I just cannot get CSS to work!!!

Discussion in 'Software' started by NeoNemesis, Dec 20, 2004.

  1. NeoNemesis

    NeoNemesis Moutharrhea

    arg, i can't even figure out how to change the text font. im trying to put together a profile page that is xhtml valid, and i want to use a style sheet.

    Here is what I got for the profile page so far:

    PHP:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
      <
    head>
        <
    meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
        <
    title>Personal Profile</title>
        <
    link rel="stylesheet" type="text/css" href="/style.css" />
      </
    head>

    <
    body style="style.css">
    <
    p>
    This is my personal profile which I have compiled and is xhtml valid.

    <
    a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a>
    </
    p>

    </
    body>

    </
    html
    And here is the lousy style sheet that i cannot get to work.
    PHP:
    <style type="text/css">
    p
    {
    font-family:verdana
    }  
    I bet im missing something extremely simple. But for the love of me, i cannot figure out what it is.
     
  2. animatorStrike

    animatorStrike <a href="http://www.acrodata.com/fun/waaa.jpg">Rid

    I'm not sure, but I think you forgot to add a period before the "p" class.

    PHP:
     <style type="text/css">
    .
    p
    {
    font-family:verdana
    }  
     
  3. NeoNemesis

    NeoNemesis Moutharrhea

    Nope that didn't work because the period is only if i want a class. I'm looking to set everything in the "p" (paragraph) part to one font.
     
  4. Kodo

    Kodo SNATCHSQUATCH

    verdana is not valid.. veranda, however, is.
     
  5. NeoNemesis

    NeoNemesis Moutharrhea

    Still no like even with arial and tohoma. Is there something wrong with the coding itself? maybe a syntax error?
     
  6. Kodo

    Kodo SNATCHSQUATCH

    did you set your class to class="p" or are you trying to make everying within the element <p> have that font?

    If it's the latter, then you don't use .p use use p

    p
    {
    css here
    }
     
  7. NeoNemesis

    NeoNemesis Moutharrhea

    Yeah, I set the element p. Which is weird. And i know for a fact that my hosting service allows for style sheets.
     
  8. Kodo

    Kodo SNATCHSQUATCH

    what is this

    <body style="style.css">

    ????

    get rid of it so it reads <body> Your REL will take care of loading the style sheet.



    [edit]

    ok, I really stopped to look at this. My mistake was assuming you understood how CSS was set up.

    CSS files do not require <style type="text/css">

    just put your elements into the css file like

    element
    {
    css....
    }


    make your REL in your head and that's it.

     
  9. NeoNemesis

    NeoNemesis Moutharrhea

    I fixed it, thanks kodo. But for some reason, I have to put all the css on one line, I cant do

    p
    {
    blah blah blah
    }

    I'm forced to do:

    p {blah blah blah}

    So maybe I will find out whats up later.
     
  10. Kodo

    Kodo SNATCHSQUATCH

    you are missing some syntax.
    you must ALWAYS end your property with a semi colon

    p
    {
    blah;
    blah2;

    }
     
  11. NeoNemesis

    NeoNemesis Moutharrhea


MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds