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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:15:39+00:00 2026-06-17T08:15:39+00:00

I have this simple CSS: .cont div { margin:10px; border:1px solid; } .mark {

  • 0

I have this simple CSS:

.cont div {

  margin:10px;
  border:1px solid;
}

.mark {   /* This get ignored? */

 margin:30px;
}

With this markup:

<div class="cont">
  <div>a</div>
  <div class="mark">b</div>
</div>

I except the div.mark having margin:30px; but at least in Chrome this isn’t true because the generic rule .cont div seems to have a higher priority.

Consider I don’t want to use !important are there any other way to solve this?

http://jsfiddle.net/xNVRm/

  • 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-17T08:15:39+00:00Added an answer on June 17, 2026 at 8:15 am

    Just make your selector more specific by adding the tag name:

    div.mark {
        margin:30px;
    }
    

    Demo: http://jsfiddle.net/xNVRm/1/

    You could also use .cont .mark if you want to avoid using the tag name.

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

Sidebar

Related Questions

I have this simple HTML / CSS <div class=image-group> <img src=http://placehold.it/80x80 /> <img src=http://placehold.it/120x120
I have this simple code for testing: <html> <head> <style type=text/css> ul{ float:left; margin:0;
I have this simple CSS... div:before { content: G'day; filter: alpha(opacity=40); -moz-opacity: .4; opacity:
This is probably a basic html/css question... I have a simple one-button form that
Pulling my hair out with this simple CSS layout. I have a 2-column fixed
I have this simple Layout in my page <div id=content-wrap> <form id=form1 runat=server> <asp:ScriptManager
I have a simple CSS problem In this site http://web.cinaird.se/pdf/test.htm (<--removed) I have a
i wonder if this is possible with simple css or if i have to
I have this simple layout in HTML: <body> <div class=container> <p class=title1>Title 1</p> <div
I have this simple html <!Doctype html> <head> <title>Uft-8</title> <meta charset=uft-8> <style type=text/css> .tr_deco{

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.