473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

why is a particular div being centered?

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
11 1543
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: VRandy | last post by:
Example: http://pages.prodigy.net/randyv/centerprb.htm The desired effect is a fixed width left margin with a fixed width div centered in the right side. If the browser is resized to become very...
5
by: Haines Brown | last post by:
I want a centered body, 680px wide, having a red bottom margin. The following works well in galeon, but not in IE5, where the bottom margin steals the full width of the viewpoint. That is, the red...
7
by: DaWoE | last post by:
Hi, I want to place a div centered of another div in IE. I get this to work in Mozilla, but not in IE. The code i use for mozilla is the following : <html> <head> <style type="text/css">
2
by: David Winter | last post by:
This is a totally trivial CSS problem, I'm sure, but I don't get it. I want a centered DIV with a fixed width between two other DIVs that should fill the rest of the window/viewport (= 100%). How...
4
by: Mimo Zus | last post by:
I'm hoping that someone can explain what's going on; better yet provide a workaround. I'm designing a centered CSS site based on a 550 pixel wide vertical background image. Onto this background...
17
by: Stian Lund | last post by:
Hello, I've been struggling with this problem for a while now, so I though I'd get some input from anyone more skilled with CSS than I am. I'm actually trying to accomplish two things with this:...
9
by: Troy Piggins | last post by:
If I use the code: ----- <div style="text-align: center;"> <a href="photos.php?img=xx1.jpg"> <img src="xx1.jpg" style="padding: 10px;" /> </a> <a href="photos.php?img=xx2.jpg">
7
by: TheLongshot | last post by:
I just recently converted a few pages of my application to using master pages. Problem is, in all of my content pages, the contents are centered. I can't figure out why. The markup in the...
3
by: gentsquash | last post by:
I'm trying to display a paragraph that has a centered phrase, such as this one, in the middle of the paragraph. An example is the section "End of semester project" on my course-page ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.