?
Solved

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

Posted on 2008-06-10
4
Medium Priority
?
1,297 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Suggested Courses
Course of the Month9 days, 16 hours left to enroll

762 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