By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,492 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,492 IT Pros & Developers. It's quick & easy.

Div Centered

P: 93

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
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 7,435
<!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.