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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:41:01+00:00 2026-05-30T21:41:01+00:00

How is the priority determined when conflicting attributes are specified directly or through css?

  • 0

How is the priority determined when conflicting attributes are specified directly or through css?

In this example, the display : none specified through css seems to be overriding the display : inline-block that is directly specified for id=1, so that element becomes visible.

<style>
.invisible{
    display : none
}​​
</style>
<div id=1 class="invisible" style="display:inline-block">Hello World</div>

In the following example, where I have two conflicting class specifications,

<style>
.invisible{
    display : none
}​​
.visible{
    display : inline-block
}​​
</style>
<div id=1 class="visible invisible">Hello World</div>

the display : inline-block specified through .visible class seems to be overriding display : none specified through .invisible class.

What are the rules that determine the priority in these cases?

  • 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-30T21:41:02+00:00Added an answer on May 30, 2026 at 9:41 pm

    To answer your question, in example one, your code is wrong…It’s not display=”inline-block”..it’s

    <div id=1 class="invisible" style="display: inline-block;">Hello World</div>
    

    inline styles always take precedence over style sheets. but because it was written incorrectly, the style sheet took over.

    In example two, the display block wins because it is declared after display:none. Browsers read code from top to bottom, so the last value you declare for a property wins (well unless you use !important tags). And again, inline styles always win. There are more priority rules, but that’s all you need for your example.

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

Sidebar

Related Questions

Possible Duplicate: Priority queue in .Net This question is similar, but i want to
As all we know: the sequence of evalutation is determined by the priority and
i have a priority queue and i have defined like this: priority_queue<Node*,vector<Node*>,greater<Node*>> myQueue; i
I need a priority queue of objects but I keep getting this error: symbol:
I'm using queue's and priority queues, through which I plan on pumping a lot
I have a priority queue implementation in C# that I want to add a
table user: |id|name|employee_priority_id|user_priority_id| table priority: |id|name| As you can see, there are two foreign
The default stl priority queue is a Max one (Top function returns the largest
If yes then why priority queue is a non-linear data structure? Does non-linear data
I need a priority queue where I can increase or decrease the priority key.

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.