 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
thanksalot
Joined: 21 Apr 2008 Posts: 2
|
Posted: Mon Apr 21, 2008 2:19 pm I am trying to stick the table absolute top left no gaps |
|
|
|
Hi, I am pulling my hair out about this, please help,
How do I "stick" this table in the absolute top left corner of the web page, I always get this 10ish px gap on top and left from it. I am trying to avoid this gap, and to lock it to top and left wall.
I use plain HTML editor , Nvu for this, how should I write it in code?
Here is the result what I got so far, need to stick it to the top left
here is the code:
Thanks A Lot!
| Code: |
<body>
<table style="text-align: left; width: 175px;" border="0"
cellpadding="1" cellspacing="0">
<tbody>
<tr style="font-family: monospace;">
<td><img style="width: 175px; height: 120px;"
alt="" src="spo1.gif"></td>
</tr>
<tr style="font-family: monospace;">
<td><img style="width: 175px; height: 120px;"
alt="" src="spo2.gif"></td>
</tr>
<tr style="font-family: monospace;">
<td><img style="width: 175px; height: 120px;"
alt="" src="spo3.gif"></td>
</tr>
<tr style="font-family: monospace;">
<td><img style="width: 175px; height: 120px;"
alt="" src="spo4.gif"></td>
</tr>
<tr style="font-family: monospace;">
<td><img style="width: 175px; height: 120px;"
alt="" src="spo5.gif"></td>
</tr>
<tr style="font-family: monospace;">
<td><img style="width: 175px; height: 120px;"
alt="" src="spo6.gif"></td>
</tr>
</tbody>
</table>
<br>
</body>
|
|
|
Straystudio
Joined: 14 Apr 2008 Posts: 264 Location: Nord Italy
|
Posted: Mon Apr 21, 2008 2:51 pm |
|
|
|
Thanks a lot for posting example, and for posting it in time before it grows to large a page.
Issue has to do with BODY Element setting.
It is a normal behaviour You meet, indeed.
All Browsers apply a default margin all around the stuff (body) the document has to display.
Slight difference among Browser brands, default margin runs around 8 pixel; if no different value is assigned in writing the document.
Telling it nothing, Browser do not takes that value as "zero", but as a "given pixel".
To have no-margin(s), You have to make the "zero" value entered;
and You will get Your TABLE as You expect.
Open Document in HTML Editor, find <body> tag and change it into:
<body leftmargin="0" topmargin="0" marginleft="0" margintop="0">
You can also assign a background-color to the body element, by entering bgcolor="" Attribute.
Color is rendered depending on the Value You enter; with words You have a few fixed standard color, as:
white (default)
black
gray
red
maroon
pink
yellow
green
blue
aqua
with other coding, You can render more ones. Works so:
#000000 #ffffff #ff0000
#555555 #9a9a9a #9a0000
Anyone may prefer to keep the margins as the Browsers do (or to fix them to a value), and giving to the whole body an appropriate BCCOLOR according to the page layout.
Now it is late here in Italy, I'll be back soon;
wishes,
ENZO
Last edited by Straystudio on Mon Apr 21, 2008 3:14 pm; edited 1 time in total |
|
thanksalot
Joined: 21 Apr 2008 Posts: 2
|
|
jessica987
Joined: 07 Sep 2008 Posts: 5
|
Posted: Sun Sep 07, 2008 8:38 pm how to align website very top and flush left with a browser? |
|
|
|
Hi,
I tried the above body code of:
| Code: |
| <body leftmargin="0" topmargin="0" marginleft="0" margintop="0"> |
however its still now working. please help, here is the page in question: http://www.jessicahope.com/3fixedtotal.html. I am thinking all the CSS is screwing up the html code? But then how do I go about using the current CSS (its the template I want/need) but also getting the content of the page to align top and left?
Thanks in advance. |
|
Straystudio
Joined: 14 Apr 2008 Posts: 264 Location: Nord Italy
|
Posted: Sun Sep 07, 2008 11:47 pm Margin and Horizontally centering DIV in XHTML |
|
|
|
The page does have BODY MARGIN already set at 0px zero pixel, all around indeed.
It is defined in CSS STYLE by:
| Code: |
body {
margin:0;
padding:0;
}
|
If You temporarily remove this piece, You'll see a white marging coming on and surrounding the coloured DIVs; moving them away from the window border. It is the default margin said above.
Your Document being a XTML 1.0 based one, as per document type declaration opening the coding:
| Code: |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> |
the Code leftmargin="0" topmargin="0" marginleft="0" margintop="0" to be added in <body> Tag as from me, it is true it has no effect; it does work in HTML layouts.
XHTML wants STYLE to set BODY MARGIN
STYLE can stay in the HEAD between <style type="text/css"> </style> Tags as shown above, or can accompany any single Element; so, in our case:
| Code: |
| <body style="margin:0px;"> |
Now, what is going wrong with Your results?
Do You wish the group to be centered in the window?
Do margin: 0 auto; in the #maincontainer DIV:
#maincontainer{
width: 840px; /*Width of main container*/
margin: 0 auto; /*Center container on page*/
padding: 0;
}
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|