简体   繁体   中英

Applying Style To All Links In The Control

I've got a div called 'menu' and inside that menu there are some divs and inside them there are hyperlinks.

I have a class for 'menu' and I also want a class to apply to all of my hyperlinks a certain height and width.

I tried .MenuDiv a{} but it didn't work

Does this help?

.Menu div a { ... }

You might alredy know this ;p

But if our class is "menu" you cant use ".MenuDiv".

Css for the links if it is an class:

.menu a{width:600px;height:200px}

<div class="menu">
<a href="#">link1</a>
<a href="#">link2</a>
<a href="#">link3</a>
</div>

It will also work if you have:

<div class="menu">
<div>
<div>
<div>
<a href="#">link1</a>
<a href="#">link2</a>
<a href="#">link3</a>
</div>
</div>
</div>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM