Solved

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

Posted on 2008-06-10
4
1,295 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

749 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