Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 165479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:55:42+00:00 2026-05-11T11:55:42+00:00

I currently have some general purpose H1, H2, H3 styles for my site which

  • 0

I currently have some general purpose H1, H2, H3 styles for my site which work great for most ‘general’ headings where I need a simple ‘traditional’ header.

 h1 { /* lots of style attributes */ }  h2 { /* lots of style attributes */ }  h3 { /* lots of style attributes */ } 

I am also creating some components where I have something like this, thats to say I need a header specific to that particular type of control.

 <div class='titledimage'><h1>Section header</h1><img .../></div>   .titledimage h1 { color:red; bottom-border: 1px solid blue; } 

The problem I’m encountering is that the h1 under titledimage is also an h1 as defined earlier so it inherits all the styles defined by h1. This is generally undesired – I just want red and 1px solid blue for the header in the .titledImage div.

I was reading and trying to answer this question about H1 styles. My conclusion is that if you are doing specific header styles (.titledimage h1) you cant really do generic header styles (h1) unless :

 a) you reset every style attribute in the '.titledimage h1' style  b) you just use a class name instead of h1  c) your `h1` style is defined with very few attributes that you'd      be overriding anyway 

I’ve noticed that for styling the YUI menu control they actually use H6 and I’m wondering if they are doing that to avoid such conflicts.

Should I

a) be using <h6> like yahoo does? b) reset every attribute defined by `h1` when I define `.titledimage h1` ? c) just use a class name for `.titledimage header`, and leave     `h1`, `h2`, `h3` for 'traditional more logical headers'  d) something else 

ideally i want to say this, but theres no such thing (to my knowledge)

 .titledimage h1 { inherit: none; color:red; bottom-border: 1px solid blue; } 
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:55:42+00:00Added an answer on May 11, 2026 at 11:55 am

    To me resetting seems wasteful. There must be a clean way to apply the /* lots of style attributes */ to the h1 tags you want it applied to while not having it apply to the h1 within a .titledimage.

    Say you had:

    <div class='top'><h1>PageName</h1></div> <div class='leftNavigation'><h1>Cat1</h1><h1>Cat2</h1><h1>Cat3</h1></div> <div class='rightMarginNote'><h1>Username</h1></div> <div class='content'>  <h1>CONTENT</h1>  <div class='titledimage'>   <h1>title</h1>  </div> </div> 

    Then you’d want your CSS a little like:

    .top h1, .leftNavigation h1, .rightMarginNote h1, .content > h1 {   /* lots of style attributes */ } .similarly h2 { /* lots of style attributes */ } .similarly h3 { /* lots of style attributes */ } .titledimage h1 { color:red; bottom-border: 1px solid blue; } 

    Instead of the alternative

    h1 { /* lots of style attributes */ } h2 { /* lots of style attributes */ } h3 { /* lots of style attributes */ } .titledimage h1, .otherCase h1, .anotherCase h1, yetAnotherCase h1 {   /* lots of style backtracking */ } .titledimage h1 { color:red; bottom-border: 1px solid blue; } .otherCase h1 { color:blue; bottom-border: 1px solid blue; } .anotherCase h1 { color:green; bottom-border: 1px solid blue; } .yetAnotherCase h1 { color:mauve; bottom-border: 1px solid blue; } 

    Also group as much of that H1-H5 stuff together as possible, and if you must go with the alernative define a class specifically for the resetting that is applied not to the h1 but to the containing div of any class.

    <div class='titledimage hReset'><h1>title</h1></div> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple class that contains some general information about the current web
I currently have some code which when you press the submit button, a marker
I have some code which I'm currently using to change the static-IP of a
I'm currently writing some general purpose .net libraries that contain usual helper classes. For
I currently have some action associated with when the user types something in a
We're coding a Java6 project under Eclipse Indigo and we currently have some compilations
I'm using Zend_Search_Lucene, the PHP port of Java Lucene. I currently have some code
Currently i have some interfaces (stripped down for here): public interface IJobGroup { string
We have some stuff that may be exported into various formats. Currently we have
I have some python code that currently performs expensive computation by performing the computation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.