navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

<span> and element 'width' ignored in FF?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Microsoft FrontPage Help >> <span> and element 'width' ignored in FF?
Page: [1]
 
phazei

 

Posts: 7
Joined: 8/23/2005
Status: offline

 
<span> and element 'width' ignored in FF? - 8/23/2005 14:28:42   
I haven't done any web design in a while (read years) and I'm just
familiarizing myself with div tags and css. I thought I had a pretty
good grasp on it, but I got stuck and google hasn't helped.

I'm working on
http://badasstutors.com/ but when I made
http://badasstutors.com/links.htm and
http://badasstutors.com/apply.htm
I used span's instead of div's for most of it because they were
inline and I needed to line some stuff side by side.

It works beautifully in IE, but firefox seems the throw it up.
(see bottom of links page).

For some reason FF is ignoring the 'width' element in everything
except div's. It won't let me make an inline frame with span.
Also I added a 'width' to the <B> tag in my declarations at the
beginning and it doesn't show up.

What am I doing wrong for it to not work in FF? Any other way
I should do it? I tried using div's with float left/right... but they
ended up weird. Can I make div work inline?

Thanks,
Adam

Tailslide

 

Posts: 6296
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: <span> and element 'width' ignored in FF? - 8/23/2005 14:56:44   
Hi Adam

I'm sorry to say this but you've got quite a bit of work on your hands there.

There's a lot of incorrect code etc. For instance you've got text and form elements which aren't in a <div> they're just floating free - this is never a good idea.

The <span> thing needs reigning in as you're using way too much markup and generally making your life difficult.

I'd do more with the CSS - for instance I'd have a div around all those checkboxes. Then you can specify a class for that particular div to float the checkboxes with a particular class name like this:

<div id="checkboxes">
<input type=checkbox name="whatever" value="1" id="whatever"><label for="Whatever">whatever</label><br />
<input type=checkbox name="another" value="2" id="another"><label for="another">Another</label><br />
<input type=checkbox name="yetanother" value="3" id="yetanother"><label for="yetanother">Yet Another/label><br />
</div>


CSS:

#checkboxes {width: 200px;}


<span> is an inline element and so it only works for things that naturally are a single line - you can't use it for block level elements or things that are on more than one line. <span>s are usually used for fairly minor changed within a single line of text.

You should also look into getting a DOCTYPE have a look here for why: http://www.alistapart.com/articles/doctype/

Edit: BTW - always test in Firefox - IE is a "broken browser" that doesn't implement CSS rules properly. Firefox isn't showing your code incorrectly - Firefox is showing you how it should look according to the code - IE was showing it incorrectly. Code for Firefox, check in Opera and fix for IE (or it'll take 10 years off your life! :))

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to phazei)
phazei

 

Posts: 7
Joined: 8/23/2005
Status: offline

 
RE: <span> and element 'width' ignored in FF? - 8/23/2005 16:10:07   
How can I set up a 3x3 grid of div tags if I don't use span?
And without using tables?

On that page I set up a 3x3 grid of span tags to set up
the borders going around the page. And based most of
it on percentages. I tried just using
div tags but they wouldn't work at all. The border grows
or shrinks if you change window size.

Also with all the checkboxes I put a span around each one
just so they'd all have equal width so if the page was
resized they'd align with eachother evenly. I tried putting
them in div tags first, but they realigned in blocks when I
did that.

I don't see any other way of doing this. I tried for a while
before using span.

I thought all the style elements were supposed to work
with all the tags for the most part.




(in reply to Tailslide)
phazei

 

Posts: 7
Joined: 8/23/2005
Status: offline

 
RE: <span> and element 'width' ignored in FF? - 8/23/2005 18:18:06   
when I do this:

<label class="botm"><input type="checkbox" name="c1" value="Basic Math ">Basic Math</label>
<label class="botm"><input type="checkbox" name="c2" value="Beginning Algebra ">Beginning Algebra</label>
<label class="botm"><input type="checkbox" name="c3" value="Intermediate Algebra ">Intermediate Algebra</label>
<label class="botm"><input type="checkbox" name="c4" value="Linear Algebra ">Linear Algebra </label>


CSS:

	.botm {
		width: 200px;
	}



So that's not going to work because width and height don't work with inline elements.
And display: inline-block; isn't supported in FF.

So I need to align div tags using absolute.

The first one could be {left:0px; width:3%;} then the next could be {left:3%; width 80%;}
and the 3rd would be {left:83%; width 3%}

But if I need the edges to be a fixed width, how would I get around that?
The first would be {left:0px; width:25px} then {left:25px; width:80%}
but what do I do with the last one? {left:??? ;width:25px;}
??? would need to be 80%+ 25px, I don't know how I could get more than 2 div columns
lined up with widths varying by percentages and pixels....

Are tables the only way?




< Message edited by phazei -- 8/23/2005 20:13:46 >

(in reply to phazei)
Tailslide

 

Posts: 6296
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: <span> and element 'width' ignored in FF? - 8/24/2005 3:30:21   
Hi again

All things are possible (well most) it's just a case of following rules carefully.

Width and height are possible with <span>s it's just a case of how it's implemented.

I'd still go with <divs> much easier and less mark-up. You wanted three groups of three checkboxes? Here you go: http://www.littleblueplane.com/test/checkboxes.html

Here's the code in case I ever get rid of that page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<title>Request more Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
<STYLE TYPE="text/css">
<!--
#wrapper {font: 76% Tahoma, sans-serif;}

#checkbox1 {width: 200px;float:left;}
#checkbox2 {width: 200px;float:left;}
#checkbox3 {width: 200px;float:left;}
-->
</STYLE>

</head>
<body>

<div id="wrapper">

<p>Please select any of the following </p>

<!-- the "label" tags make the form more accessible for those using text readers -->

<div id="checkbox1">
<input type=checkbox name="service1" id="service1"><label for="service1">Service One</label><br />
<input type=checkbox name="service2" id="service2"><label for="service2">Service Two</label><br />
<input type=checkbox name="service3" id="service3"><label for="service3">Service Three</label><br />
</div><!-- end checkbox1 -->

<div id="checkbox2">
<input type=checkbox name="service4" id="service4"><label for="service4">Service Four</label><br />
<input type=checkbox name="service5" id="service5"><label for="service5">Service Five</label><br />
<input type=checkbox name="service6" id="service6"><label for="service6">Service Six</label><br />
</div>

<div id="checkbox3">
<input type=checkbox name="service7" id="service7"><label for="service7">Service Seven</label><br />
<input type=checkbox name="service8" id="service8"><label for="service8">Service Eight</label><br />
<input type=checkbox name="service9" id="service9"><label for="service9">Service Nine</label><br />
</div>

</div><!-- end of wrapper div  -->


</body>
</html>


Much less mark-up than with all those spans -easier to change it too. I've put these checkbox groups in a containing div called wrapper. You can control where the three groups appear on the page by shifting the Wrapper div around.

Position:absolute is generally a bad idea for any large chunks of the page. It's not that it can't be used it's just that it has the tendency to cause you more problems than it solves. I have used it for placing a navigation bar but usually I'll use it for smaller things like a "skip link". I definitely wouldn't use it for whole divs - too much trouble!!

My advice would be to:

a. Include a DOCTYPE (there's one on the checkbox.html page you can use)
b. Put all the contents of your page inside a container div and then you can position that much more easily.
c. Leave the checkboxes within the Wrapper div otherwise the floating items will interfere with whatever comes next on the page.
d. Make sure all text has the relevant tags around it - some of your "loose" text needs <p> tags.
e. Don't lose heart - this is a good start and it does get a lot easier!

My plan for your page structure would look like this:
<body>

<div id="container">
  
        <div id="header">
             <h1>Badass Tutors</h1>
             <p>Get a Badass Tutor</p>
        </div><!-- end header div-->

        <div id-"main">
             <form>
             (your main form stuff goes here)

             <div id="wrapper">
            
                  <div id="checkbox1">
                       (first lot of checkboxes
                  </div> <!-- end checkbox 1 div -->

                   <div id="checkbox2">
                        (second lot of checkboxes)
                   </div>  <!-- end checkbox2 div -->

                   <div id="checkbox3">
                        (third lot of checkboxes)
                   </div>  <!-- end checkbox3 div -->

          </div>  <!-- end wrapper div -->

       <h2>Other stuff</h2>
       (other stuff goes here)
   
    </div>  <!-- end main div -->
 
     <div id="footer">
          (footer stuff goes here)
     </div>  <!-- end footer div -->

</div> <!-- end container div -->

</body>


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to phazei)
Tailslide

 

Posts: 6296
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: <span> and element 'width' ignored in FF? - 8/24/2005 6:07:20   
Oh I forgot to mention (*slaps head*)

Floating in general has a few "quirks" - for instance sometimes floating more than two divs to the same side can cause you problems. If this turns out to be the case for you then, making sure the wrapper div has the correct width on it, float the right-hand box right instead of left.

Also - IE misbehaves in unpredictable ways with floats - for instance sometimes it treats them like inline elements rather than the correct block level.

One way round lots of the IE floaty bugs is to add this: display:inline to the div's CSS. Don't ask me why it works, doesn't look like it should, it isn't logical but it does work.

Here's a link to an excellent site that will help you with this sort of thing: http://www.positioniseverything.net/

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Tailslide)
phazei

 

Posts: 7
Joined: 8/23/2005
Status: offline

 
RE: <span> and element 'width' ignored in FF? - 8/25/2005 4:19:31   
WOOT, it is possibly W/O IE quirky mode!!! :):):):)
http://www.badasstutors.com/apply.htm

When using align left.... clear:both is a must

-Adam

(in reply to phazei)
Page:   [1]

All Forums >> Web Development >> Microsoft FrontPage Help >> <span> and element 'width' ignored in FF?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts