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

  • SEARCH
  • Home
  • 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 1032273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:03:16+00:00 2026-05-16T14:03:16+00:00

I know that it’s incorrect to style a <section> tag but how about the

  • 0

I know that it’s incorrect to style a <section> tag but how about the <header> and <footer> tags. If using these tags provides a more semantic markup then they should be used, however, if they can’t be styled then a <div> would still need to be inserted inside the tag to wrap the content and style it.

I know that <header> can be styled but I’m not sure if it’s correct to do so.

So the question is: Should html5 tags be styled or should a <div> be placed inside to take care of the styling?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-16T14:03:16+00:00Added an answer on May 16, 2026 at 2:03 pm

    Nothing in the spec says you can’t or shouldn’t style HTML5 elements such as <section> or <article>. It only says that you shouldn’t place a semantic HTML5 element somewhere ‘for the sake of‘ styling something. Use a <div> instead.

    So if you have a semantic reason to add the <section> or <article> somewhere, then by all means add it AND also feel free to style it as well. But if you have to wrap a section of your mark-up for styling purposes (eg. to add a border, or float left etc.), but that section does not have any semantic meaning in your mark-up, then use a <div>.

    For instance:

    <div class="mainBox">
        <nav class="breadcrumbs">
            <ol>
                <li>...list of links (snip)....</li>
            </ol>
        </nav>
    
        <section>
            <h1>Latest Tweets From Twitter</h1>
    
            <article>
                //... a Tweet (snip)... //
            </article>
    
            <article>
                //... a Tweet (snip)... //
            </article>
    
            //... lots more Twitter posts (snip)... //
    
        </section>
    
    </div>
    

    The <section> element is the main part of your page (ie. your list of tweets) and also has a heading at the start which is required. But it’s wrapped in a div.mainBox element because maybe you want to wrap a border around the both the breadcrumbs and section parts, ie. it’s purely for styling. But there’s nothing to stop you styling the <section> and <article> elements also.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that usually you want to strip these out, but I need the
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
I know that just using rand() is predictable, if you know what you're doing,
I know that IList is the interface and List is the concrete type but
I know that we shouldn't being using the registry to store Application Data anymore,
I know that for parsing I should ideally remove all spaces and linebreaks but
I know that I can use ubuntu server to host a website, but what
I know that the foreach loop used in the following example doesn't compile. But
I know that default mail transport could be set in bootstrap file but how
I know that JavaScript doesn't support private members, but you can emulate those. I'm

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.