By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,879 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,879 IT Pros & Developers. It's quick & easy.

why is a particular div being centered?

P: n/a
http://www.frostjedi.com/terra/scrip...loat-form.html

The div with red background is being centered and I don't know why.
Any ideas?

I'd like for it to be on the left...
Feb 22 '08 #1
Share this Question
Share on Google+
11 Replies


P: n/a
rf

"yawnmoth" <te*******@yahoo.comwrote in message
news:cc**********************************@q70g2000 hsb.googlegroups.com...
http://www.frostjedi.com/terra/scrip...loat-form.html

The div with red background is being centered and I don't know why.
Any ideas?
It's not being centred. It is stacking up to the right of that input field
because you have floated both of them left. Well, rather, the input field is
inside a div that is floated left. If you look real close you will note that
the top of the red div is above (and to the right) of the input field.

The clear: right on the div that contains your offending red div has no
effect on prior left floated elements.

This is some bizarre mark up. You should study up on what float really
means.

--
Richard.
Feb 22 '08 #2

P: n/a
rf wrote:
"yawnmoth" wrote:
>... Any ideas?

This is some bizarre mark up. You should study up on what float really
means.
And it's using an XHTML doctype, but written in HTML. :-/

--
-bts
-Friends don't let friends drive Vista
Feb 22 '08 #3

P: n/a
On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
rf wrote:
"yawnmoth" wrote:
... Any ideas?
This is some bizarre mark up. You should study up on what float really
means.

And it's using an XHTML doctype, but written in HTML. :-/
Here's a fun little experiment. Take this page:

http://www.frostjedi.com/terra/scrip...fox-xhtml.html

Perfectly valid XHTML according to validator.w3.org. Now view that
page in Firefox and save it as HTML. eg. File -Save Page As. Open
the resultant page and look at it. You'll see it's no longer valid
XHTML. And take a look at the junk it adds to the body background css
property.

So I do apologize for not using valid XHTML. I also apologize for
using Firefox to save a page in an attempt to isolate the problem. Oh
well. RIP Firefox.

*sigh*
Feb 22 '08 #4

P: n/a
yawnmoth <te*******@yahoo.comwrites:
On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
>rf wrote:
"yawnmoth" wrote:
... Any ideas?
This is some bizarre mark up. You should study up on what float really
means.

And it's using an XHTML doctype, but written in HTML. :-/

Here's a fun little experiment. Take this page:

http://www.frostjedi.com/terra/scrip...fox-xhtml.html

Perfectly valid XHTML according to validator.w3.org. Now view that
page in Firefox and save it as HTML. eg. File -Save Page As. Open
the resultant page and look at it. You'll see it's no longer valid
XHTML. And take a look at the junk it adds to the body background css
property.
Not here. What changes when you do it?

--
Ben.
Feb 22 '08 #5

P: n/a
yawnmoth wrote:
On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
>rf wrote:
>>"yawnmoth" wrote:
... Any ideas?
This is some bizarre mark up. You should study up on what float really
means.
And it's using an XHTML doctype, but written in HTML. :-/

Here's a fun little experiment. Take this page:

http://www.frostjedi.com/terra/scrip...fox-xhtml.html

Perfectly valid XHTML according to validator.w3.org. Now view that
page in Firefox and save it as HTML. eg. File -Save Page As. Open
the resultant page and look at it. You'll see it's no longer valid
XHTML. And take a look at the junk it adds to the body background css
property.
But served as text/html

Date: Fri, 22 Feb 2008 17:34:47 GMT
Server: WebServerX
Last-Modified: Fri, 22 Feb 2008 17:02:25 GMT
Etag: "131834b-18b-47bf0021"
Accept-Ranges: bytes
Content-Length: 395
Content-Type: text/html

200 OK

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Feb 22 '08 #6

P: n/a
In article
<1b**********************************@71g2000hse.g ooglegroups.com>,
yawnmoth <te*******@yahoo.comwrote:
On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
rf wrote:
"yawnmoth" wrote:
>... Any ideas?
This is some bizarre mark up. You should study up on what float really
means.
And it's using an XHTML doctype, but written in HTML. :-/

Here's a fun little experiment. Take this page:

http://www.frostjedi.com/terra/scrip...fox-xhtml.html

Perfectly valid XHTML according to validator.w3.org. Now view that
page in Firefox and save it as HTML. eg. File -Save Page As. Open
the resultant page and look at it. You'll see it's no longer valid
XHTML. And take a look at the junk it adds to the body background css
property.
What version of FireFox did you use? I get exactly the same page
back every time I save the above URL with FireFox 2.0.0.12,
whether I save the page directly or view the source first and
then save.
So I do apologize for not using valid XHTML. I also apologize for
using Firefox to save a page in an attempt to isolate the problem. Oh
well. RIP Firefox.
[Misquote]
I don't think you saved what you thought you were saving...
[/Misquote]
Feb 22 '08 #7

P: n/a
On Feb 22, 11:35 am, "Jonathan N. Little" <lws4...@central.netwrote:
yawnmothwrote:
On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
rf wrote:
"yawnmoth" wrote:
... Any ideas?
This is some bizarre mark up. You should study up on what float really
means.
And it's using an XHTML doctype, but written in HTML. :-/
Here's a fun little experiment. Take this page:
http://www.frostjedi.com/terra/scrip...fox-xhtml.html
Perfectly valid XHTML according to validator.w3.org. Now view that
page in Firefox and save it as HTML. eg. File -Save Page As. Open
the resultant page and look at it. You'll see it's no longer valid
XHTML. And take a look at the junk it adds to the body background css
property.

But served as text/html

Date: Fri, 22 Feb 2008 17:34:47 GMT
Server: WebServerX
Last-Modified: Fri, 22 Feb 2008 17:02:25 GMT
Etag: "131834b-18b-47bf0021"
Accept-Ranges: bytes
Content-Length: 395
Content-Type: text/html

200 OK
Hmmm. That seems like a likely culprit. I know with CSS, Firefox
won't treat it as CSS unless the Content-Type is text/css. mod_mime
(I think) will set the Content-Type automatically to that if the
extension is *.css, but if it's *.php or whatever, you'll have to set
it, yourself. Here's an example:

http://www.frostjedi.com/terra/scripts/demo/phpcss.html

I tried, incidentally, using a meta tag to set the Content-Type to
text/xhtml but I'm still getting HTML when I save. I guess I'll need
to create an .htaccess rule or something, but I'm somewhat hesitant to
do that, because not all the *.html's I have actually are XHTML. Some
really are HTML.

Seems like I probably ought to post this on mozillazine.org...
Feb 22 '08 #8

P: n/a
yawnmoth wrote:
>"Beauregard T. Shagnasty" wrote:
>rf wrote:
>>"yawnmoth" wrote:
... Any ideas?
>>This is some bizarre mark up. You should study up on what float really
means.

And it's using an XHTML doctype, but written in HTML. :-/

Here's a fun little experiment. Take this page:

http://www.frostjedi.com/terra/scrip...fox-xhtml.html

Perfectly valid XHTML according to validator.w3.org.
The above page is not valid.
Now view that page in Firefox and save it as HTML. eg. File -Save
Page As. Open the resultant page and look at it. You'll see it's no
longer valid XHTML. And take a look at the junk it adds to the body
background css property.

So I do apologize for not using valid XHTML. I also apologize for
using Firefox to save a page in an attempt to isolate the problem.
Oh well. RIP Firefox.
Why would you want to use a browser to save pages? View the source and
paste it into your text editor instead. Keep the browser; it's a good
one.

--
-bts
-Motorcycles defy gravity; cars just suck
Feb 22 '08 #9

P: n/a
On Feb 22, 11:49 am, David Stone <no.em...@domain.invalidwrote:
In article
<1b8ef567-7571-4f4d-8397-c5ec97106...@71g2000hse.googlegroups.com>,

yawnmoth<terra1...@yahoo.comwrote:
On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
rf wrote:
"yawnmoth" wrote:
... Any ideas?
This is some bizarre mark up. You should study up on what float really
means.
And it's using an XHTML doctype, but written in HTML. :-/
Here's a fun little experiment. Take this page:
http://www.frostjedi.com/terra/scrip...fox-xhtml.html
Perfectly valid XHTML according to validator.w3.org. Now view that
page in Firefox and save it as HTML. eg. File -Save Page As. Open
the resultant page and look at it. You'll see it's no longer valid
XHTML. And take a look at the junk it adds to the body background css
property.

What version of FireFox did you use? I get exactly the same page
back every time I save the above URL with FireFox 2.0.0.12,
whether I save the page directly or view the source first and
then save.
So I do apologize for not using valid XHTML. I also apologize for
using Firefox to save a page in an attempt to isolate the problem. Oh
well. RIP Firefox.

[Misquote]
I don't think you saved what you thought you were saving...
[/Misquote]
I've been saving as "Web Page, complete". I just tried to save as
"Web Page, HTML only" and got the exact same page (instead of the
Firefox altered one). Maybe someone could confirm?
Feb 22 '08 #10

P: n/a
yawnmoth wrote:
>
I tried, incidentally, using a meta tag to set the Content-Type to
text/xhtml but I'm still getting HTML when I save.
Of course you will. It uses whatever MIME type you have set for .html on
your local PC. Whatever it was on the remote server is irrelevant at
this point. A meta tag won't do anything to change that on your local
system, either. You won't get an XHTML content type unless you view it
through a local web server with the proper configuration.

--
Berg
Feb 22 '08 #11

P: n/a
yawnmoth wrote:
>
I've been saving as "Web Page, complete". I just tried to save as
"Web Page, HTML only" and got the exact same page (instead of the
Firefox altered one).
"Web Page complete" is altered so all the file references (<imgetc)
will work correctly once it's downloaded to your local drive. There may
be other changes as well but I've never bothered looking at them.
Regardless, it is not intended to be identical to the remote page.

If you want the page in it's unaltered state, View Source the online
page and save *that*.

--
Berg
Feb 22 '08 #12

This discussion thread is closed

Replies have been disabled for this discussion.