MetaChat REGISTER   ||   LOGIN   ||   IMAGES ARE OFF   ||   RECENT COMMENTS




artphoto by splunge
artphoto by TheophileEscargot
artphoto by Kronos_to_Earth
artphoto by ethylene

Home

About

Search

Archives

Mecha Wiki

Metachat Eye

Emcee

IRC Channels

IRC FAQ


 RSS


Comment Feed:

RSS

06 March 2009

Ask MeCha (HTML edition) Is there a way to center paragraphs to a fixed-width in HTML without the use of a style sheet?[More:]

All the Google results I get involve style sheets and I don't think I can do that with the email service we use (Constant Contact; it's easy to use and was recommended by our creative agency). I have an image that's 432 pixels wide and I'd like to have the width of the centered paragraphs below the image be just slightly inside that, like 400 pixels across.

Can I do that with just "simple" HTML?
You can use CSS inline like so:

<div style="width: 400px">WHEE</div>

Or, better still, define your styles in a style section:

<style>
.caption { border: 1px solid red; width: 100px; }
</style>
<div class="caption">WHEE</div>

I'd be shocked if you couldn't use an external style sheet, though.
posted by eamondaly 06 March | 12:11
Is your beard obscuring your eyesight, eamon? She said without a stylesheet!


;p

What about using a table? Clunky, but it might work.
posted by mudpuppie 06 March | 12:23
@eamondaly: We don't have a place to store style sheets atm, but the <div> tags were exactly what I needed! What do they mean, and what exactly do they do?

@mudpuppie: I was looking at the table option earlier and the code looked very clunky. Something that has only a few variables I need to change should I want to re-use this HTML template for a future mailing is the best way to go for me and my boss' need to constantly revise things until they're perfect.
posted by TrishaLynn 06 March | 12:29
Yeah, a table would be pretty awful. CSS is the way to go, except it's not an option.

The Beard comes through with the Divs!
posted by mudpuppie 06 March | 12:35
I think TrishaLynn meant that she didn't think she could use external style sheets, not "no CSS styling at all". I don't know of any mail campaign software that doesn't let you import any HTML you want, CSS included.

A "div" is just a logical grouping element on a page, typically rendered as a block. You can style almost any element using CSS, not just divs.
posted by eamondaly 06 March | 13:04
Yaay! I didn't get the job! || Since I Do Not Have MOFB. . .

HOME  ||   REGISTER  ||   LOGIN