HighDots Forums  

Right aligned floats and content linearity

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Right aligned floats and content linearity in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Headless
 
Posts: n/a

Default Right aligned floats and content linearity - 09-07-2003 , 07:53 AM






A right aligned float next to a paragraph needs to be placed before the
paragraph in the source, this causes the content order to be opposite in
the visual and aural domain.

Anyone know of a solution to that problem?


Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm

Reply With Quote
  #2  
Old   
SantaKlauss
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 09:24 AM






Headless wrote:
Quote:
A right aligned float next to a paragraph needs to be placed before the
paragraph in the source, this causes the content order to be opposite in
the visual and aural domain.
Anyone know of a solution to that problem?
Hi Headless, the first three solutions that come in my mind are:

- float the paragraph to left instead the div to the right
- float them both, one to left and the other to right
- use absolute positioning

HTH,
SantaKlauss




Reply With Quote
  #3  
Old   
Headless
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 10:19 AM



SantaKlauss wrote:

Quote:
| A right aligned float next to a paragraph needs to be placed before the
| paragraph in the source, this causes the content order to be opposite in
| the visual and aural domain.
| Anyone know of a solution to that problem?

Hi Headless, the first three solutions that come in my mind are:

- float the paragraph to left instead the div to the right
Won't work. (the paragraph will occupy the full width)

Quote:
- float them both, one to left and the other to right
Won't work. (see above)

Quote:
- use absolute positioning
Won't work. (absolutely positioned elements are removed from the flow)


Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm


Reply With Quote
  #4  
Old   
SantaKlauss
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 12:00 PM



Headless asked, SantaKlauss answered and Headless replied:

Quote:
| A right aligned float next to a paragraph needs to be placed before the
| paragraph in the source, this causes the content order to be opposite in
| the visual and aural domain.
| Anyone know of a solution to that problem?

Quote:
Hi Headless, the first three solutions that come in my mind are:
- float the paragraph to left instead the div to the right

Won't work. (the paragraph will occupy the full width)
Yes, it's true.

Quote:
- float them both, one to left and the other to right

Won't work. (see above)
I' ve worked on this solution, and it will be sufficient to
specify the width of the two elements:

p#content{
float: left;
width: 70%;
}

div#sidenote{
float: right;
width: 29%;
border: 1px solid #000
}

For a strange reason, Opera 7.1 won't float the sidenote if the sum of
percentages is 100%, so I put on 99%.

Quote:
- use absolute positioning
Won't work. (absolutely positioned elements are removed from the flow)
I think it will work. Try to put the two elements on a relative positioned container
to allow absolute positioning in it. For example:

<div style="position: relative">
<p style="position:absolute; top:0; left:0; width:80%">
<!-- paragraph content here -->
</p>
<div style="top:0; right:0; width:20%">
<!--sidenote content here-->
</div>
</div>

Have a look on the tutorial on positioning on www.brainjar.com
and keep in mind that IE will consider padding as part of the width,
while other browsers, correctly, don't. You could find Tantek's
Box Model hack here:
http://tantek.com/CSS/Examples/boxmodelhack.html

HTH,
SantaKlauss




Reply With Quote
  #5  
Old   
Stan Brown
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 12:29 PM



In article <ouimlv8c7dtjd832pr0mhad8ak6h7v9s60 (AT) 4ax (DOT) com> in
comp.infosystems.www.authoring.stylesheets, Headless
<me (AT) privacy (DOT) net> wrote:
Quote:
SantaKlauss wrote:

- use absolute positioning

Won't work. (absolutely positioned elements are removed from the flow)
Of course you _could_ specify appropriate margins ...

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/


Reply With Quote
  #6  
Old   
Headless
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 01:22 PM



SantaKlauss wrote:

Quote:
| >| A right aligned float next to a paragraph needs to be placed before the
| >| paragraph in the source, this causes the content order to be opposite in
| >| the visual and aural domain.
| >| Anyone know of a solution to that problem?

| >Hi Headless, the first three solutions that come in my mind are:
| >- float the paragraph to left instead the div to the right

| Won't work. (the paragraph will occupy the full width)

Yes, it's true.

| >- float them both, one to left and the other to right

| Won't work. (see above)

I' ve worked on this solution, and it will be sufficient to
specify the width of the two elements:

p#content{
float: left;
width: 70%;
}
Won't work (text won't flow beneath the float).


Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm


Reply With Quote
  #7  
Old   
Headless
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 01:23 PM



Stan Brown wrote:

Quote:
- use absolute positioning

Won't work. (absolutely positioned elements are removed from the flow)

Of course you _could_ specify appropriate margins ...
You've lost me, explain please.


Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm


Reply With Quote
  #8  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 01:46 PM



Headless <me (AT) privacy (DOT) net> wrote:

Quote:
A right aligned float next to a paragraph needs to be placed before the
paragraph in the source, this causes the content order to be opposite in
the visual and aural domain.

Anyone know of a solution to that problem?
I'm afraid there's no solution, if you wish to get the specific visual
effect.

As a workaround, you might consider putting an "invisible" explanation of
the situation before the floated element, using a transparent single-pixel
gif with the explanation as the alt text:
<div><img alt="The following paragraph is an illustration of the
principle described after it." src="transp.gif" width="1"
height="1"></div>

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #9  
Old   
SantaKlauss
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 02:15 PM



Santaklauss wrote and Hedleass replied:

Quote:
I' ve worked on this solution, and it will be sufficient to
specify the width of the two elements:

p#content{
float: left;
width: 70%;
}

Won't work (text won't flow beneath the float).
Well, as I inteded your question, it will work... since
you didn't specified that you wanted the text to flow
even under the floated sidenote (or image or whatever).
Guess there's no solution though...

Greetings,
SantaKlauss




Reply With Quote
  #10  
Old   
Eric B. Bednarz
 
Posts: n/a

Default Re: Right aligned floats and content linearity - 09-07-2003 , 08:11 PM



"SantaKlauss" <santaklaussHATESSPAM (AT) mail (DOT) md> writes:

Quote:
p#content{
float: left;
width: 70%;
}

div#sidenote{
float: right;
width: 29%;
border: 1px solid #000
}

For a strange reason, Opera 7.1 won't float the sidenote if the sum of
percentages is 100%,
The sum of the width would be 100% + 2px, me thinks.

Quote:
so I put on 99%.
As long as the containing block's content area is >= 200px, that works
(if I can calculate that, no rocket science is involved).

Quote:
and keep in mind that IE will consider padding as part of the width,
while other browsers, correctly, don't.
Hear, hear.


--
"The average usefulness of a thread is inversely proportional to the
cube of the number of groups it is posted to."
--Korpela's 42nd Law about Usenet


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.