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 6 of 6
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    semantics question

    Hi folks,

    I am getting into the real nitty gritty of semantics with a mix of OCD, perhaps but I need to keep CSS simple as possible.

    Do you assign a class to your H1 tags or do you have multiple classes for the container? I should point out that, I have many pages using the main_content div but the positioning of the H1 is different, either left, or centered or something else. I wonder if I should keep main_content standard and assign a second class or should I have many different h1 tags on the css. Maybe I shuld keep the basic tags standard across all pages but put the specifics for each in thier own class - a bit like a 1:many relationship in MySQL?

    Code:
    <div id="main_content a_class_here"> 
            <h1>header text here:</h1>
    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #2
    Regular Coder
    Join Date
    Oct 2007
    Location
    Glencoe, Ontario, Canada
    Posts
    340
    Thanks
    19
    Thanked 27 Times in 27 Posts
    Alot of coders specify how they want their h1 h2 and h3 tags too appear. maybe you should do the same.
    Eric "PitbullMean" Melo
    Always Start your layout with*{border:0; margin:0; padding:0;}
    Be sure to Thank ALL Users who give assistance.

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    yeh thanks for the reply but, the h1 will be semantically necessary on each page but, it layout/font/structure, may be different.

    what I want to know is, should suhc changes be stored in the individual h1 or in the secondary css tag, associated with the main declaration i.e. the a_class_here tag?



    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Only the common things should be stored in the first class. If you need to change its position on each page you could add the second class or an id as you will probably only have one h1 on the page. You could even assign an id or class to the body element and style the headers that way.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    You could even assign an id or class to the body element and style the headers that way.
    whoop, you mean something like

    Code:
    body #main_content h1.new_class
    ?
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    No not quite. I said add it to the body element. Each page would have a different ID or class. It can even be generated dynamically according to whatever page you are on. Then you just style it that way.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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