Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Embedding CSS into HTMl

Options
  • 26-06-2007 3:05pm
    #1
    Registered Users Posts: 862 ✭✭✭


    Hello,

    Just a quick one, I have a HTML page and a stylesheet seperated and the stylesheet is linking in, however I need to have the stylesheet embedded into the HTMl.

    Whats the easiest way to do this?


Comments

  • Registered Users Posts: 55,519 ✭✭✭✭Mr E




  • Closed Accounts Posts: 545 ✭✭✭alienhead


    save your style sheet in the root folder, or a style folder and use the tag below to call it.

    this uses "style.css"

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

    compredé?


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    <style type="text/css">
    ; insert contents of existing stylesheet file
    </style>

    Why embed it, though ? 90% of the time, a separate CSS file is better:

    1) only downloaded once, with each page that relies on it significantly smaller
    2) no chance of typos or anomalies on individual pages
    3) easier to make site-wide changes later by simply editing the one file


  • Registered Users Posts: 862 ✭✭✭crybaby


    im just embedding it because its for an email and I have read that embedding the stylesheet is better for that type of thing

    cheers for your help guys will be back on for more questions if I cant get it working!


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    If its an html mail ... then I strongly recommend tables for design and layout ... (the one and only time I'll recommend it) to see what I mean .. check out how your emails display in the various internet mail clients / thunderbird / outlook / mutt ... and so on :)


  • Advertisement
  • Registered Users Posts: 862 ✭✭✭crybaby


    to be honest with ya for the moment im stuck with the CSS, because it would just take far too long to go back and do it again in tables and I'm not sure whether I could keep the same design aswell

    outlook and thunderbird do a fine job of displaying it not sure about the other clients and im fairly certain no-one i send it to will be using Mutt but will test them and if it does turn out disastorous i suppose my only option really would be to go back to square one on it

    thanks for the help


Advertisement