shayan Posted June 16, 2014 Share Posted June 16, 2014 Hi guys iv a problem in css and if you help me i really appreciate that i wrote this: <!doctype html><html><head><style type="text/css" >p {border:solid 3px orange;background-color:yellow;color:green;padding:40px;}</style></head><body><p>This is the fist para</p></body></html> ............................................................................... so you can see there is a text in the border but the text is in the left i wana to be at the center and also i want to make left and right width shorter so if you can help me please pm me Link to comment Share on other sites More sharing options...
newseed Posted June 16, 2014 Share Posted June 16, 2014 One way is to add a span tag into the paragraph tag something like this:<p style="text-align:center;"><span style="background: yellow; padding: 40px;">I will give it a go.</span></p> Link to comment Share on other sites More sharing options...
Day Posted June 18, 2014 Share Posted June 18, 2014 <!doctype html><html><head><style type="text/css" > p { text-align: center; } span { border: solid 3px orange; background-color: yellow; color:green; padding:40px; display: inline-block; }</style></head><body><p><span>This is the fist para</span></p></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now