Possible to set border outline smaller?

It really annoys me how with borders/outlines it surrounds the object from all the way from the left to all the way to the right. Is there any way to set it differently? http://i.imgur.com/uYdkjde.png I’m thinking you would use a div then resize the div but I can’t figure out how to do that.

By default div tags are block level i.e. they take up all the available horizontal space their containing element allows.

Maybe you’re after something like

div.whatever { 
  display: inline-block;

Sorry, what does that do?

<style>#example { 
  display: inline-block;
<div id="example">

Try giving it a border / outline and the difference should be clear

Instead of

The element generates a block element box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.