473,385 Members | 1,707 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,385 software developers and data experts.

Images & Text

J
I am new to web design and I am looking for some advice on putting
images within paragraphs of text. I have determined that sizing the
height of my images to a given number of lines of text seems to work
well, however:

If for example I align the image to the left, I will then put a border
on the top, bottom, and right edges of my image which matches my
background, in order to provide aesthetically pleasing space between
the image and surrounding text, and also keep the left image edge flush
with the adjacent left text margin. I am inclined to leave my
cellpadding/cellspacing settings alone because I like the way
everything else looks. But I am inclined to think there is a better
way to do this (either with css or html) and would appreciate a
suggestion.

John

Apr 1 '06 #1
7 3581
J
Addendum -- I realize after posting that cellpadding/spacing has
nothing to do with the internal positioning of images within a single
cell. Apologies for that misleading info.

Apr 1 '06 #2
On 31 Mar 2006 19:24:54 -0800, in comp.infosystems.www.authoring.stylesheets "J"
<sk*********@yahoo.com> wrote:
I am new to web design and I am looking for some advice on putting
images within paragraphs of text. I have determined that sizing the
height of my images to a given number of lines of text seems to work
well, however:

If for example I align the image to the left, I will then put a border
on the top, bottom, and right edges of my image which matches my
background, in order to provide aesthetically pleasing space between
the image and surrounding text, and also keep the left image edge flush
with the adjacent left text margin. I am inclined to leave my
cellpadding/cellspacing settings alone because I like the way
everything else looks. But I am inclined to think there is a better
way to do this (either with css or html) and would appreciate a
suggestion.

John


I have found the following construction to be useful.

First, make sure your HTML files can find your css file:

<head>
<LINK REL=StyleSheet HREF="./cvproj.css" TYPE="text/css" MEDIA=screen>
</head>

Note: You can name your css file anything you want to; "href="./mycss.file",
"href=./thatdamnedcomplicated.css"...

In your css file:

div.photoleft { float: left;
margin-right: 15px;
margin-top: 15px;
margin-bottom: 15px;
text-align: center; }

div.photoright { float: right;
margin-left: 15px;
margin-top: 15px;
margin-bottom: 15px;
text-align: center; }

Examples for your HTML:

<div class="photoright">
<img src="http://www.history.navy.mil/photos/images/g370000/g373816t.jpg"
alt="USS Essex" title="CV-9 USS Essex, May 1945" width=200 height=158>
<br>
<i>USS Essex</i> (CV-9) underway during<br>the Okinawa campaign, May 1945.<br>
U. S. Navy photo from<br>the U. S. Naval Historical Center
</div>

<div class="photoleft">
<img src="http://www.history.navy.mil/photos/images/h97000/h97488kt.jpg"
alt="USS Ticonderoga" title="CV-14 USS Ticonderoga, ca. 1970-72" width=200
height=158>
<br>
A post-refit modernised<br><i>Essex</i>-class carrier.<br>This is CV-14 <i>USS
Ticonderoga</i><br>in the early 70s.<br>
U. S. Navy photo from<br>the U. S. Naval Historical Center
</div>

You mentioned "(putting in) a border on the top, bottom, and right edges of my
image which matches my background, in order to provide aesthetically pleasing
space between the image and surrounding text." The MARGIN-top/bottom/left/right:
99px parameters in the CSS do just that, and they are transparent; your
background will show through.

For detailed explanations of the various elements and parameters used, I
recommend the Web Design Group site at http://www.htmlhelp.com/ .

HTH
--
Money can't buy happiness, but it can let you rent it for a while...
Apr 1 '06 #3
J
William,

This worked well. Many thanks.

John

Apr 3 '06 #4
In article <11**********************@v46g2000cwv.googlegroups .com>, J
<sk*********@yahoo.com> writes
I have determined that sizing the height of my images to a given number
of lines of text seems to work well


Based on what? How do you know what size the user will have their text?
How do you know how wide their browser window is? If they change the
width, it may change the way the lines wrap/break, resulting in a
different number of lines from your intention.

Not criticising, just pointing out that you can't make assumptions about
the user's settings.

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 3 '06 #5
On Mon, 3 Apr 2006, Alan Silver wrote:
In article <11**********************@v46g2000cwv.googlegroups .com>, J
<sk*********@yahoo.com> writes
I have determined that sizing the height of my images to a given
number of lines of text seems to work well
Based on what? How do you know what size the user will have their
text?


Regular text? It'll be 1.0em. Line *height* is typically somewhat
larger - but if you size the image in em units, you'll be aiming at
some approximation to the intended size. The quality of the result
may be less than ideal, though, since browsers can be a bit rough and
ready when resizing images on the fly. Avoid indexed image formats
when doing this (jpeg may be a good choice - of course the flip side
is that jpeg can't do transparency).
How do you know how wide their browser window is?
Don't know - don't want to know. Design should be chosen for its
ability to adapt well across a good range of user settings.
If they change the width, it may change the way the lines
wrap/break, resulting in a different number of lines from your
intention.


That's what flexible design is all about. The image can still be
sized in em units to be consonant with the text.
Apr 3 '06 #6
On 3 Apr 2006 07:54:10 -0700, in
comp.infosystems.www.authoring.stylesheets "J" <sk*********@yahoo.com>
wrote:
William,

This worked well. Many thanks.

John


de nada. Always happy to help.

Money can't buy happiness, but it can let you rent it for a while...
Apr 4 '06 #7
In article <Pi*******************************@ppepc55.ph.gla. ac.uk>,
Alan J. Flavell <fl*****@physics.gla.ac.uk> writes
<snip>

I think we are saying the same thing here. My point was that the OP
implied (although that may have been incorrect) that images were to be
sized based on how large (ie pixel size) the text was. I was merely
pointing out that you don't know that. I didn't get the impression that
he was referring to sizing in the browser, more to sizing them to a
specific number of pixels in Photoshop (or whatever).

You are right in that you can resize the images in the browser, and
choose ems as units, but the impression I got from the OP's post was
that this was *not* what was being suggested. If it was, then nothing
more to add.

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 4 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: K | last post by:
I have found a script online that I want to use (I am new to PHP). It creates dynamic images based on the text that you pass it. However, no matter how I try, I can't get anything other than a...
5
by: The Plankmeister | last post by:
Ello... Is there a way to recreate the "text-align : justify" behaviour with images? (add to wish list: "image-align : justify") I have a gallery page and would like all the images to properly...
8
by: Michael Kalina | last post by:
Hi! On my website (http://michaelsremarks.blogspot.com) I use a so called flickr-badge. That is some sourcecode that takes a picture out of my flickr-gallery and puts it onto my website. Now...
2
by: sylvian stone | last post by:
Hi, I'm trying to do something that has always been easy with tables - namely use a three column layout, and above the main layout, show three images - one on the absolute left, one on the absolute...
10
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images....
13
by: Egil Helland | last post by:
I am trying to create a breadcrumb with both icons and text, looking like: Home > Trail > Trail Now, how on earth do I get the images and text to vertically align so that the vertical...
2
elamberdor
by: elamberdor | last post by:
Hi All! Well, i'm modifying a dynamic map, with lat and long datapoints, my problem is it loads in text perfectly onto exact points I specify on the map, ..well now I want to load in...
6
by: UKuser | last post by:
Hi Folks, Is there a way, I can hide images through CSS and then display the alt tags? I want to create a Javascript free CSS/Cookies approach to doing text- only. I've set the style for...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.