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

Text and Pic

P: n/a
Hi, new here.

I'm designing a site. The page in question has a navbar on left taking 15%
of the screen. A header, containing a centered graphic, requires about
200px.

What I want is to have a picture on the right margin and the text not go
through the picture, as it does now. I figured out how to do this, but I
forgot.

Here's the CSS I have so far. Other than the text passing through the pic,
it looks right.

div.pcontent {

position: absolute;
top: 200px;
left: 20%;
width: 80%;

}
div.photoright {

position: absolute;
top: 200px;
right: 0;
padding: 1em;

}

Help?
Jul 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
If it's any help, here's the page in question:
http://www.opro.org/newdesign/nsbio.html

And the css is at http://www.opro.org/newdesign/default.css

Looks right, if only the text would wrap before the picture...

"Neal" <ne**@spamrcn.com> wrote in message
news:bp**********@bob.news.rcn.net...
Hi, new here.

I'm designing a site. The page in question has a navbar on left taking 15%
of the screen. A header, containing a centered graphic, requires about
200px.

What I want is to have a picture on the right margin and the text not go
through the picture, as it does now. I figured out how to do this, but I
forgot.

Here's the CSS I have so far. Other than the text passing through the pic,
it looks right.

div.pcontent {

position: absolute;
top: 200px;
left: 20%;
width: 80%;

}
div.photoright {

position: absolute;
top: 200px;
right: 0;
padding: 1em;

}

Help?

Jul 20 '05 #2

P: n/a
*Neal* <ne**@spamrcn.com>:

What I want is to have a picture on the right margin and the text not go
through the picture, as it does now.


This is the perfect usecase of "float: right". That requires that the 'img'
is in the correct container, though.

--
The Hitchhiker's Guide to the Galaxy:
"The Universe, as has been observed before, is an unsettlingly big place,
a fact which for the sake of a quiet life most people tend to ignore."
Jul 20 '05 #3

P: n/a
"Christoph Paeper" <cr***********@gmx.net> wrote in message
news:bp***********@ariadne.rz.tu-clausthal.de...
*Neal* <ne**@spamrcn.com>:

What I want is to have a picture on the right margin and the text not go
through the picture, as it does now.
This is the perfect usecase of "float: right". That requires that the

'img' is in the correct container, though.

--
The Hitchhiker's Guide to the Galaxy:
"The Universe, as has been observed before, is an unsettlingly big place,
a fact which for the sake of a quiet life most people tend to ignore."


What would you suggest in my case?

Jul 20 '05 #4

P: n/a
*Neal* <ne**@spamrcn.com>:
"Christoph Paeper" <cr***********@gmx.net> wrote
*Neal* <ne**@spamrcn.com>:

What I want is to have a picture on the right margin


This is the perfect usecase of "float: right". That requires that the 'img'
is in the correct container, though.


What would you suggest in my case?


As said, use "float: right" on the image that is put inside the text's
container.
Do you want me to publish an illustrated step-by-step tutorial for it?

--
Useless Fact #7:
It cost 7 million dollars to build the Titantic and 200 million to make a movie
about it!
Jul 20 '05 #5

P: n/a

"Christoph Paeper" <cr***********@gmx.net> wrote in message
news:bp***********@ariadne.rz.tu-clausthal.de...
This is the perfect usecase of "float: right". That requires that the 'img' is in the correct container, though.


What would you suggest in my case?


As said, use "float: right" on the image that is put inside the text's
container.
Do you want me to publish an illustrated step-by-step tutorial for it?


What confused me was that it seemed you were saying my img was "not" in the
correct container, but I didn't know what the correct container was. I see
now you're saying to put the img in the same div as the text and to style it
float: right; but I didn't get that from your original message. Thanks for
clarifying.

No need for a step-by-step tutorial. However, if anyone knows of good
resources dealing specifically with positioning and layout in CSS, I'd love
to see them, as that aspect of CSS is the hardest for me to grasp.
Jul 20 '05 #6

P: n/a
Update: I attempted setting the img tag as float: right; within the same
<div> as the text. Result was the pic was to the right and the text was
after the pic. Attempts to put text and img in separate containers seems to
always result in text over the pic, and never in text wrapping before the
pic, which is desired.

So that I can move onto other challenges, I've changed the design of that
page to something less ideal that will work. If anyone has other ideas on
how to format the text so I can get the desired effect, I'd appreciate it.
Apologies if I seem a pain in the butt - as said, the positioning aspect of
CSS I don't quite fully grasp yet.

Thanks for the time.
Jul 20 '05 #7

P: n/a
*Neal* <ne**@spamrcn.com>:

Update: I attempted setting the img tag as float: right; within the same
<div> as the text. Result was the pic was to the right and the text was
after the pic. Attempts to put text and img in separate containers seems to
always result in text over the pic, and never in text wrapping before the
pic, which is desired.


AFAICS you're trying to mix "position: absolute" with "float: right", which
won't lead to success. Do only either one.

<div class="pcontent leftofpic">
<img class="photoright" src="pics/nealsmal.jpg" ... />
<h1>About the Conductor</h1>

.photoright {
margin-top: 100px;
float: right;
padding: 1em;
width: 250px;
}

--
To be or not to be -- that's no question, it's a decision.
Jul 20 '05 #8

P: n/a

"Christoph Paeper" <cr***********@gmx.net> wrote in message
news:bp***********@ariadne.rz.tu-clausthal.de...
AFAICS you're trying to mix "position: absolute" with "float: right", which won't lead to success. Do only either one.


I got it there! Thanks a heap for your help. Check it out at
http://www.opro.org/newdesign/nsbio.html

Here's what it took.

html --

<div class="pcontent">
<h1>Heading</h1>
<div class="leftofpic">
<img class="rightoftext" />
<p>text here</p>
</div></div>

css --

div.pcontent {
position: absolute;
top: 200px;
left: 20%;
width: 75%;
padding: 0;
margin: 1em;
}

img.rightoftext {
float: right;
padding: 1em;
width: 250px;
margin: 0;
margin-left: 1em;

}

div.leftofpic {
float: left;
margin-top: 200px;
width: 90%;
margin: 1em;
}
Jul 20 '05 #9

P: n/a
On Wed, 19 Nov 2003 18:23:10 -0500, Neal <ne**@spamrcn.com> wrote:
I got it there! Thanks a heap for your help. Check it out at
http://www.opro.org/newdesign/nsbio.html


Just a few friendly comments:

- The edge of the text "The Old Post Road Orchestra" is not too
pretty to look at, possibly due to a ressizing of an image.

- You have a problem with the menu when you resize the browser
window (making it narrow). This is visible in both IE, Opera
and Mozilla, but best in the latter two.

- In Opera there is no space (and in IE just a little) below
last paragraph. You might want to add a little more space here,
to make the end of your page look prettier.

--
Ole Kristian Bangås
Jul 20 '05 #10

P: n/a

"Ole Kristian Bangås" <ol******@netconnect.no> wrote in message
news:op**************@news.individual.net...
- The edge of the text "The Old Post Road Orchestra" is not too
pretty to look at, possibly due to a ressizing of an image.
The gif? I agree. The graphic person's coming up with a new one at-size.
This is tweaked as best as I can for now.
- You have a problem with the menu when you resize the browser
window (making it narrow). This is visible in both IE, Opera
and Mozilla, but best in the latter two.
I'm going for good layout at 800x600 and up. I see the problem, probably due
to using % instead of ems. I'd think using % would not stick content behind
the nav bar, but it seems to.

- In Opera there is no space (and in IE just a little) below
last paragraph. You might want to add a little more space here,
to make the end of your page look prettier.


That is bothering me as well. I've tried upping the margin on that div,
still cuts off. That border hits the lower edge of the browser everytime.
What'll work here?
Jul 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.