+ 2
What is difference between( outline and border )?
In language program CSS for example for use : outline: 10px solid green; border: 10px solid green; same code But what is difference?
4 Réponses
+ 2
Outlines can be offset, don’t have a radius property to round the corners, and you can’t style only one side. They do not affect the object’s position or the space it takes up in the page. Borders can’t be offset, have a radius property to round the corners, and you can style the sides separately. Borders are part of the DOM model, so they do make the object bigger in the page.
I usually see the outline as a debugging tool and the border as a style tool
+ 2
border is intended for styling purpose, outline is primarly intended for visually shown focused elements (related to tabindex to let user switch between form elements with tab key )...
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
+ 1
Thanks
@Just
0
237 anx3.