473,408 Members | 2,734 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,408 software developers and data experts.

Text and Pic

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
10 2981
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
*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
"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
*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

"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
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
*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

"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
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

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

Similar topics

1
by: joes | last post by:
Hello there ! I rendering a PDF with XSLT using Xalan and FOP. I like to place in my article an image, so that the text is floating around the image. I tried several things but it didn't work so...
3
by: Xerxes | last post by:
Hi, I need help in setting up a page where the text wraps around an image. Right now, I am using table, with text in one <td> and the image in the adjacent <td>. The problem is when the text is...
2
by: Macsicarr | last post by:
Hi All Wonder if you could help me. I have created a CMS system that allows the user to enter text and pic 'tags' for their own About us page, eg text.... text.... text.... text.......
2
by: Jiri Palecek | last post by:
I have a question on web authoring (probably HTML+CSS). Is it somehow possible to put two words above each other inside a paragraph so the result would be valid and render at least in Mozilla? I...
4
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
3
by: jweinberg1975 | last post by:
I would like for users to be able to select from a small number of options that come from a little drop down menu which then closes. .....
3
by: bbepristis | last post by:
Hey all I have this code that reads from one text file writes to another unless im on a certian line then it writes the new data however it only seems to do about 40 lines then quits and I cant...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file....
10
by: bluemountain | last post by:
Hi there, Iam new to python forms and programming too I had a text file where i need to extract few words of data from the header(which is of 3 lines) and search for the keyword TEXT1, TEXT2,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.