Jump to content
Sign in to follow this  
shayan

Need help in width

Recommended Posts

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

 

 

 

 

 

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
Share on other sites
<!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>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...