davej Posted June 29, 2013 Share Posted June 29, 2013 So now there is another layer called outline? http://www.w3schools.com/css/css_outline.asp <!DOCTYPE html><html><head><style>body {margin: 10px;padding: 0;border: 0; }#img1{background-color: blue;padding: 10px; /* blue */border: 10px solid red;outline: 10px solid green; /* outline is outside border using any existing margins */margin: 0;}</style></head><body><img id="img1" src="http://www.w3schools.com/images/w3css.gif" alt="alt"/></body></html> Link to comment Share on other sites More sharing options...
Ingolme Posted June 29, 2013 Share Posted June 29, 2013 Outline has always been around if I remember correctly, it doesn't add anything to the box, neither outside or inside, it just overlays what's around it, I think. Internet Explorer didn't support this property back then so people didn't use it. The outline property doesn't interfere with the box model, it won't change its size or reposition it. Try this example and set the outline as thick as you want, it won't change the box's size or position like border or margins would. http://www.w3schools.com/css/tryit.asp?filename=trycss_outline Link to comment Share on other sites More sharing options...
davej Posted June 29, 2013 Author Share Posted June 29, 2013 Since it is used to indicate "focus" I suppose it has been around for awhile, but I don't remember playing with it before. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now