TECH Middle of page HTML

Limp_Brisket

Active Member
Jan 2, 2006
48,290
Utah
Code:
<img src="image.jpg" style="display: block; margin-left: auto; margin-right: auto;" />
preferably not inline.
 
Jun 1, 2001
6,242
USA
Exactly like that!

Do I need to know CSS or is there a way to do it with HTML?

just copy the code from the 1st part and save it as index.html, then copy the code from the 2nd part and save it as style.css and put it in the same directory.

In your index.html look for "Content goes Here" and replace that with your content...

in the index.html you'll also need to change this

<link media="screen" type="text/css" rel="stylesheet" href="webtoolkit.clayout.css" />

to this
<link media="screen" type="text/css" rel="stylesheet" href="style.css" />
 

carrathanatos

extremely mean in the meanest way
Jun 10, 2008
1,143
phx
Exactly like that!

Do I need to know CSS or is there a way to do it with HTML?

if you were 100% deadset on using html, and all you were doing was the picture, i'd do something like this:

<table width="100%" height="100%">
<tr>
<td valign="center" align="center">
<img src="blah.xxx" />
</td>
</tr>
</table>

(shrug)

css would be a little nicer, though. :) you could even still use the table thing above, using this in your css:

#centerPicture{
width:100%;
height:100%;
}

#centerPicture td{
align:center center;
}

and then in your html, simply:

<table id="centerPicture">
<tr>
<td>
<img src="blah.xxx" />
</td>
</tr>
</table>

all of those terms may not be 100% correct, as i'm doing it off of the top of my head, but it shows how css works. if you want to learn more, i've always used w3schools.com as a great reference guide.
 
TS
TS

nucklearknight

New Member
Sep 21, 2008
365
San Francisco, California
if you were 100% deadset on using html, and all you were doing was the picture, i'd do something like this:

<table width="100%" height="100%">
<tr>
<td valign="center" align="center">
<img src="blah.xxx" />
</td>
</tr>
</table>

(shrug)
Thanks a lot!
I had to fiddle with it so I could have some text and a picture centered but it works like a charm!
 

Users who are viewing this thread

About Us

  • Please do not post anything that violates any Local, State, Federal or International Laws. Your privacy is protected. You have the right to be forgotten. Site funded by advertising, link monetization and member support.
OT v15.8.1 Copyright © 2000-2022 Offtopic.com
Served by fu.offtopic.com

Online statistics

Members online
235
Guests online
58
Total visitors
293

Forum statistics

Threads
369,746
Messages
16,916,409
Members
86,875
Latest member
ddunn9448