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 8400915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:40:22+00:00 2026-06-09T21:40:22+00:00

Is it wise / good practice to give the SPAN tag different classes within

  • 0

Is it wise / good practice to give the SPAN tag different classes within a DIV. For example styling paragraphs of text that need a specific layout / position colour etc… ?

Or are there better / more efficient ways?

  • 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-06-09T21:40:24+00:00Added an answer on June 9, 2026 at 9:40 pm

    You would have less HTML if you gave the paragraph itself the class, rather than wrapping the contents of a paragraph with a span, but it’s perfectly possible to do what you’ve said. You can of course give multiple paragraphs the same class:

    HTML:

    <div>
        <p class="paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p class="paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p class="paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    

    Or give the div a class and select the paragraphs using that.

    HTML:

    <div class="paragraphs">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    

    CSS:

    div.paragraph p { }
    

    Or each one a different class giving you plenty of flexibility

    HTML:

    <div>
        <p class="paragraph1">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p class="paragraph2">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p class="paragraph3">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    

    If you need to just highlight different bits of a single paragraph, then a span is acceptable, but don’t forget to consider ready made tags like strong or em.

    <p>Lorem ipsum dolor sit amet, <strong>consectetur</strong> adipiscing elit.</p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

oh wise list, We need a scalable solution that can handle many concurrent requests
Is it wise to have include guards around template classes? Aren't template classes supposed
What are the implications (SEO-wise) of having the same resource at many different URLs?
For example, let's say there is a custom template tag {% custom_tag parameter %}
Good day all; I am trying to manually (not using sublayers) draw images within
Occasionally there is a JS framework or library that thinks it's a really wise
Is it wise to create views in Cocoa that have dimensions around 15000 pixels?
Our project is working within fairly close quarters code-wise (a lot of changes happening
Short: I am looking for a very simple (configuration/maintenance wise) solution, that would allow
I'm creating a simple tag system that allows me to link a tag to

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.