span width:100% in Firefox ?

Posted on 2006-06-04
Last Modified: 2012-05-05
following works as expected in IE (colors full line), but only colors those dots in Firefox:
<span style="background-color:#eaeaff;width:100%;">.....</span>

how can i fix it for Firefox ?
( it does work if i use div, but i don't like that it breaks line, but if i use display:inline i get same  problem as above )

Question by:ed987
    LVL 49

    Expert Comment

    Add also display:block;

    display:inline elements cannot have a width.

    LVL 7

    Author Comment

    no, that would break line, which i really don't wan't
    LVL 49

    Expert Comment

    What do you mean with break line? How would a 100% wide element not be on a single line?

    LVL 8

    Expert Comment

    This should do the trick:

    <span style="background: #ccc; width: 100%; display: block; float: left;">................ </span>

    Actually that is exactly what Roonaan said...have you tried this yet?
    LVL 8

    Accepted Solution

    Try... using



    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    755 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

    19 Experts available now in Live!

    Get 1:1 Help Now