|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how do i center an image?
Hi,
i made a splash page image 783 x 452 so that it should fit snug in a browser with a resolution of 800x600. My problem is i want to center it so there's no white space around the edges, in other words, no scrolling. How do i accomplish this? thanksNadvance! |
|
#2
|
||||
|
||||
|
place it inside of <center> tags
or make a css class and center it that way etc... |
|
#3
|
||||
|
||||
|
Actually, for the record, the <center> tag is depricated as of HTML v4.01.
CSS is a good choice. Alternately, you can adjust the alignment of the image right in the image tag. Code:
<img src='/images/my_pic.jpg' border='0' alt='my picture!' title='my picture!' width='700' height='60' vspace='1' hspace='1' align='center' valign='top' /> Or, you can use a <div> tag to manage the alignment. Code:
<div align='left' valign='top'> <img src='/images/my_pic.jpg' border='0' alt='my picture!' title='my picture!' width='700' height='60' vspace='1' hspace='1' /> </div>
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#4
|
||||
|
||||
|
yeah I know, is why I offered more than one alternative
as always css is the best choice, but there are multiple methods to accomplish this. ![]() |
|
#5
|
||||
|
||||
|
Quote:
My bad Onslaught, wasn't trying to dis' you. ![]() |
|
#6
|
|||
|
|||
|
If you mean you want to get rid of the whitespace between the edge of the screen and the image you simply have to remove the body element's margins and padding (IE and Mozilla consider the space a margin, but Opera considers it padding I believe). The *best* way to do this is with CSS like so:
Code:
<style type="text/css">
body {
margin: 0px;
padding: 0px;
}
</style>
|
|
#7
|
|||
|
|||
|
Quote:
ahhhh, thats precisely what i meant! thanks a million folks! |
|
#8
|
||||
|
||||
|
Quote:
![]() |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > how do i center an image? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|