Jump to content

Change div's width to amount of text...


cs.punk

Recommended Posts

What I am trying to do is a little 'title' box which will show where on the website you are (navigation wise).

 

For example Home / Products / Test

 

But it keeps resizing to the full width of the screen. I just want it to stretch to how long the 'text' is.

 

I tried using float, which does the job but seems to mess up with the design as the second div below it, merges into the it... (see pic attached)

 

Basically what I have is:

.clear {font-size: 1px; height: 1px;}

.sbar {
    margin-left: 20px;
    float: left;
    clear: left;
}

.main {
    margin-left: 250px;
    margin-right: 30px;

}

.loc {
    width: auto;
    clear: both;
    margin-left: 270px;
    float: left;
}

 

And

 

<div class='loc'>
  <div class="tll">
   <div class="trl"><p class='loct'>Home/</p></div>
  </div>
</div>


<div class='sbar'>
<div class="bl">
<div class="br">
  <div class="tl">
   <div class="tr">...</div>
  </div>
</div>
</div>
<div class="clear"> </div>
</div>


<div class='main'>
<div class="blm">
<div class="br">
  <div class="tl">
   <div class="trm">Wellcome!</div>
  </div>
</div>
</div>
<div class="clear"> </div>
</div>

 

All those divs are just the round corners I am implementing...

 

Any ideas?

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.