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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:31:49+00:00 2026-06-17T03:31:49+00:00

According to this source , when there are conflicting CSS styles on the same

  • 0

According to this source, when there are conflicting CSS styles on the same element, embedded styles override external styles but that is not what I have observed.

I have the following HTML (simplified):

<html>
<head>
  <link rel="stylesheet" type="text/css" href="foundation.min.css" />
  <style type="text/css">
  .dialog_error_container
  {
    display: none;
  }
  </style>
</head>
<body>
  <div class="dialog_error_container alert-box alert">...</div>
</body>
</html>

I was expecting to see the rule defined for .dialog_error_container taking precedence over the one for div.alert-box but I got the opposite result (see the image below)

enter image description here

Please explain to me why the embedded style doesn’t override the external style.

  • 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-17T03:31:51+00:00Added an answer on June 17, 2026 at 3:31 am

    The source cited is in error. Check out the authoritative specification: CSS 2.1, clause 6.4.1 Cascading order. With respect to “origin”, both external and embedded style sheets are “author style sheets”. Thus, the next criterion is specificity, and .dialog_error_container (just a class selector) is less specific than div.alert-box (element type selector combined with class selector).

    Using div.dialog_error_container instead would make the specificity equal. Then “sort by order” would step in, and the embedded style sheet would win – not by virtue of being embedded but due to being later (the style element in this case appears after the link element that refers to the external style sheet).

    Thus, it would be safer (against future reorganizations of the style sheets) to make the specificity higher, e.g. by using body div.dialog_error_container (a bit artificial, but it works, and it’s better than using !important, which should be last resort only).

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

Sidebar

Related Questions

According to this page navigating between highlighted usages: (source: jetbrains.com ) can be done
I saw that there's many, many thread about this on the web, also in
According to this source code for the Arrays class, the method asList passes an
I cannot use gsl_matrix because my app is closed source and, according to this
According to the answers in this comparison question , there's no technical difference between
I'm looking for the android sources that are hosted on kernel.org (according to this
This is not a question specific about some javascript detail but I'm looking for
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
I didnt find anything according this issue. Can jaas be used to secure my
I have made a custom suface button according this example: <Button> <Button.Template> <ControlTemplate TargetType=Button>

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.