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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:57:15+00:00 2026-05-23T03:57:15+00:00

#iddiv span { display: inline-block; width: 190px; } .myclass { width:10px; } Then I

  • 0
#iddiv span {
    display: inline-block;
    width: 190px;
}
.myclass {
    width:10px;
}

Then I have

<div id="iddiv">
    <span>hello:</span> 
    <span class="myclass">yeah</span> <br/>
</div>

I would like the first span‘s width to be 190px, and second’s to be 10px. But both are 190px: why it’s not overriding the width propoerty?

EDIT: Thanks for your responses. What about unsetting width? I don’t want 10px width, just default width as if it was undefined

  • 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-23T03:57:16+00:00Added an answer on May 23, 2026 at 3:57 am

    Because id+selector (#iddiv span) is more specific than a class. Either

    #iddiv span.myclass
    

    or

    #iddiv .myclass
    

    should work for this case.

    Learn more about CSS specificity here or by Googling it.

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

Sidebar

Related Questions

i have the html as follows <div class=element-container id=div_3> <div id=submit_submit class=element> <div class=fleft>
I have a set of nested divs: <div style=border:solid 1px #7F9DB9; height:535px; width:285px; id=div_master>
<div id=id class=div-style><img id=id class=img-style></div> I would like to use the id attribute as
i have a div: <div id=div></div> with $(#div).append(<div id='c'></div>) $(#c).length returns 0. what i
Suppose you have some <div> s: <div id=div_num1></div> <div id=div_num2></div> <div id=div_num3></div> You can
I have the following part of DOM: <div id=content> <div id=div-1></div> <!-- here new
I have a span tag in html and this <span> can appear multiple times
i have created the following function to show and address in JS: function showMapForm(idDiv,
<asp:UpdatePanel runat=server ID=udp_RemitEditor UpdateMode=conditional OnPreRender=LoadParameters> <ContentTemplate> <div id=div_RemitEditor style=width:225px; display: none;> <asp:UpdatePanel ID=upnl_RemitEditor runat=server
Hello all I have a question relating to x86. In the Intel manual some

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.