Solved

Left Justify a Page

Posted on 2006-07-24
6
359 Views
Last Modified: 2010-04-06
Please can anyone tell me the best way to left justify a web page?  So that, the left edge of the page sits against the left edge of the screen (with 10px of padding).

Thanks!!

Ubee...
0
Comment
Question by:a466-ub52
  • 2
6 Comments
 
LVL 13

Accepted Solution

by:
Mark_FreeSoftware earned 250 total points
ID: 17166474
using just a little css, this can be done fairly easy:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Q_21929293.html</title>
<style type="text/css">
<!--
body,html {
margin:0px;
padding:0px;
padding-left:10px;
}
-->
</style>
</head>

<body>
<p>Hello, this text aligns directly to the top,<br>
and 10 px from the left.</p>
<hr>
<p>&nbsp; </p>
<div style="background-color:#00FF00;">
  <p>This div is also aligned 10px from the left,</p>
  <p>just like the &lt;hr&gt; above </p>
</div>
</body>
</html>
0
 
LVL 30

Expert Comment

by:callrs
ID: 17173597
Awesome dude. I gotta learn more CSS!
0
 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 17174557

this is not part of the Q,
but here are some tuts to get you started:

http://www.practicalpc.co.uk/webbuilding/design/css1.htm
http://www.wise-women.org/tutorials/csstut/

0
 
LVL 5

Assisted Solution

by:floorman67
floorman67 earned 250 total points
ID: 17177106
great solution for a few pages but if it is for jsut a single page you can do it with fewer keystrokes by adding this to the body tag

<BODY LEFTMARGIN=10>
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question