Solved

How to make a span NOT break line while using display:block;

Posted on 2008-06-10
4
1,291 Views
Last Modified: 2011-10-19
Hi,

I'm beginner-level in CSS and I'm trying to do a fixed width class for a block (class bb in attached example) that will also NOT break the line so I can add a link on the right.

Yet, to have it at fixed width i have to use display:block but the only way i know to prevent line break is to put "display:inline", yet it cancels the display:block behavior and the class adjusts to the width of the text in the bb class...

it seems like a very basic question, however, no matter what search terms i try, there's no way I can find an answer to that on the Internet.

So my question is: how can I have a fixed width BB class and keep the following link on the SAME line.

Thanks

( see the attached sample )
ztest.txt
0
Comment
Question by:GizmoBlaster
  • 2
4 Comments
 
LVL 42

Expert Comment

by:David S.
ID: 21756998
Give the bb class float:left
0
 
LVL 9

Accepted Solution

by:
zemond earned 50 total points
ID: 21757002
set them both to float:left; in the css keep display:block; and then you can set there width,

The answer to the question that will follow this one is

after the floated objects do this

<div style="clear:both;"></div>

You'll know what I mean soon enough
0
 

Author Closing Comment

by:GizmoBlaster
ID: 31466026
Thanks guys.
0
 

Author Comment

by:GizmoBlaster
ID: 21761190
Thanks guys that worked well. Just for the record, the even simpler solution turned out to include the "clear:both" in the bb class, which spares me the trouble of adding a div.

Thanks again!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now