SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    do they have to go in the head

    Do I have to declare styles in the head or can they go in the body? I know you can use inline styles, but I wnat to declare the following in the body for the whole page:

    <style type="text/css">
    <!--
    .accesskey{text-decoration:underline;color:#00FF00}
    -->
    </style>

    monkey
    monkey - the rest is history

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    No they can't. What's the reason you need them in the body Monkey?

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,528
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    but I wnat to declare the following in the body for the whole page:

    <style type="text/css">
    <!--
    .accesskey{text-decoration:underline;color:#00FF00}
    -->
    </style>
    You'll need to explain what you mean with a little more clarity as you are not making a lot of sense

    The class of accesskey (.accesskey) will apply to any (and all) elements in the page that have been given that class. e.g. <a class="accesskey" href="#">etc... (Unless of course they are overridden by more specific styles of course)

    The styles should be in the head or preferably an external stylesheet. Most of the time inline styles should be avoided at all costs.

    Paul

  4. #4
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its not the end of the world, I just wanted to add the style sheet and some code to an existing include file to save me adding it manually to every page - cheers
    monkey - the rest is history

  5. #5
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    That's why it helps to put an include in the <head>

  6. #6
    SitePoint Enthusiast MstrBob's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not include it in your external CSS file if you want it for every page?

  7. #7
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want the content of the include to appear in the body of the page, so putting it in the head would be pointless!

    The css is only to be included if a condition is met in a peice if asp code, hence the need for it to be outside my usual .css file

    cheers
    monkey - the rest is history


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
  •