467,910 Members | 1,772 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

Div Centered


I want to allign a div block in the center of the screen. The text i this div should be text alligned left. However I am not sure how to do this. I am also using CSS to achive this.

I thought I could have a Div the width of 100% then allign that Center. Have another div in this where I text allign to the Left.

However this does not work and help would be appreciated. Thanks in advance
Mar 12 '08 #1
  • viewed: 1202
1 Reply
Expert 4TB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<style type="text/css">

<div style="text-align:left;width:50%;margin:0 auto;background-color:#ccc">
<p>aligned left</p>

Mar 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Haines Brown | last post: by
2 posts views Thread by David Winter | last post: by
17 posts views Thread by Stian Lund | last post: by
7 posts views Thread by TheLongshot | last post: by
3 posts views Thread by gentsquash | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.