简体   繁体   中英

How do I only show half of my div?

I've got a button with 100px height, 100px width and a border radius of 100px . This makes a 360 degree circle, but I only want to hide half of it. I've searched for everything but I can't find it. Does anyone know how to do this?

Thanks!

Make a parent div, add overflow: hidden; and position: relative; to it. In the child div, do position: relative; and top: -50px;

By "hide half of it", what do you mean?

Do you want a semicircle?

width:100px;
height:50px;
border-radius:50px 50px 0 0;

Or something else? Please elaborate further and I can provide more options ;)

You can put it in another div with height: 50px and overflow:hidden . That should do the trick.

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