简体   繁体   中英

How can I make div to get square border even though it has border-radius setting

Now I am working on HTML page.

And I made div with 'border-radius: 150px', so this div has radius border.

But I need to give this div square border. Of course not only exact border, maybe similar thing like border is ok.

But I don't know how can I do this. Please let me know.

Thank you.

EDIT

Now I found that outline is not same working for Chrome and Firefox. In Chrome outline is only for itself area, but in Firefox outline is for area including it's children dom nodes. Now I want to make Firefox as same as Chrome's outline action. How can I do this in Firefox.

Hope this is what you are looking for.

:)

 div { background: red; width: 300px; height: 300px; border-radius: 150px; outline: 5px solid green; } 
 <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