Apply style to the classes and not effect the others in navagation LI?

qwertyyuiop

When adding style to bmenu more importantly the margin/padding, font size,font weight to btmenu it apply them too all the ones under it like submenu li . How can I separate the styles to not apply them to submenues?
I dont want the text to look like its 50 pixels down, dont want the font weight or centered yet.. how can I only apply style to the classes and not effect the others?????.
Whatever style I apply to:
btmenu li a
it will apply to
submenu li a
and I dont want that I want each style separate.

#btmenu{
z-index:1;
position:relative;
width:100%;
list-style: none;
margin:0;
padding:0;
height:62px;
text-align:center;/* this is applied to submenu*/
}
#btmenu > a{
font-weight:bold;/* this is applied to submenu*/
font-size:15px;/* this is applied to submenu*/
height:62px;/* this is applied to submenu*/
line-height:62px;/* this is applied to submenu*/
text-align:center;/* this is applied to submenu*/
}
ul#btmenu > li{ 
padding:0;
margin:0;
display: inline;
}
#btmenu li > a{
margin-left:1%;
margin-right:1%;
text-align:center;
display:inline-block;
text-decoration:none;
color:#000;
padding-left:1%;
padding-right:1%;
text-transform:uppercase;
vertical-align: middle;
}
#btmenu > li > a:hover{
background-color:#333;
color:#FFF; 
}
/*     SUB MENU     */
.sub_menu{
display:none;
}
#btmenu > li:hover > .sub_menu{
position:absolute;
display:inline-block;/*no need for height or width*/
vertical-align: middle;
margin:0 auto;
text-align:center;
background-color:#666;
list-style: none;
margin:0;
padding:0;
display:table;
padding-right:3px;
border:#333 solid 2px;
border-radius: 4px;
}
.sub_menu > li{
margin:0px;
border: 1px solid blue;
display:inline-block;
vertical-align: middle;
height:125px;
width:47%;
}
.sub_menu  > li a{
display:block;
vertical-align: middle;
height:200px;
width:200px;
text-decoration:none;
color:#FFF;
margin:0;/* not applied??*/
padding:0;/* not applied???*/
}
.ee{margin:0;
padding:0;}
<ul id="btmenu">



<li class="top_quote">
  <a href="services">services</a>
<ul class="sub_menu">
<li class=""><a href="services"><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href="services"><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href="services"><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href="services"><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href="services"><img src="" width="189" height="189" alt=""></a></li>
</ul>



</li>



<li class="top_quote">
<a href="locations">locations</a>
 

<ul class="sub_menu">
<li class="ee"><a href="tel:16142585555">test1</a></li>
<li class="ee"><a href="tel:16148411111 ">test2</a></li>
<li class="ee"><a href="tel:16148859957">test3</a></li>
<li class="ee"><a href="tel:16148689999">test4</a></li>
<li class="ee"><a href="tel:16144212222">test5</a></li>
<li class="ee"><a href="tel:16144978888">test6</a></li>
<li class="ee"><a href="tel:16142585555">test7</a></li>
<li class="ee"><a href="tel:16148690006">test8</a></li>
</ul>

</li>


<li class="top_quote"><a href="partners">partners</a>
 

<ul class="sub_menu">
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>
<li class=""><a href=""><img src="" width="189" height="189" alt=""></a></li>

</ul>




</li>
<li class="top_quote"><a href="ourwork">our work</a></li>
<li class="top_quote"><a href="contact">contact</a></li>


</ul>

qwertyyuiop

moved the style from .btmenu to

#btmenu > a {
font-weight:bold;/* this is applied to submenu*/
font-size:15px;/* this is applied to submenu*/
height:62px;/* this is applied to submenu*/
line-height:62px;/* this is applied to submenu*/
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to apply style for classes

Apply CSS style only to specific li element

how to apply style for 'ul' and 'li' and 'a' in same class?

How to style a group of <li> without affecting others in the same page

Click to apply style to an element whilst removing from others

Apply CSS rules only if set classes are present, and not others

apply style to CSS classes with different numbers

How to apply style to multiple classes on hover of an element?

how to add style effect for elements inside of echo using classes ?

inline-block apply a top effect on blocks when one is higher than others

Can I apply different <LI> styles using classes

RequiredFieldValidator,... effect on others controls

It is possible to give list-style-type for some elements of <li> and for others dont?

Last <li> not in place with others

How to apply style on first child of multilevel recursive classes

Apply CSS-Style to HTML classes created with javascript

Apply style to all nested li div's excluding the first li div

DIV has multiple classes assigned, but I want to apply a style to only one of those classes, is it possible?

make a style for a class and remove it for others

Apply Parallax effect into GridView

Style triggers produce no effect

<use/> a <symbol/> with <style/> to apply CSS rules based on classes applied to parent HTML

Set style for li:before

change <li> style by click

javascript effect only works on the first element but not on others?

jQuery Enlarge Effect - First Run Different then Others

Applying hover effect on multiple li

social media li hover effect

Hover effect on LI from edge

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive