Jump to content

Title with background color same size and content


jorginho_monteiro
 Share

Recommended Posts

hi, i hope im posting this in the correct place, i dont know html very well, what im trying to learn is how to create a background box around the title that stretches to the size of the title and is got only a couple of pixels bigger asper example in the picture enclosed. im really sorry if this is not explained properly but i dont know the technical terms. I want to do this in html as my wordpress blog lets me create a text box with custom html without the need to change the css file.

 

many thanks in advance.

 

kind regards

 

Jorge

post-175916-0-56808600-1408628718_thumb.png

Link to comment
Share on other sites

<div> with black background with <p> inside. You should check out the relevant tutorials at w3schools

Link to comment
Share on other sites

Background attachment

 

<html><head><title>Background Attachment</title></head><body><div style="background:blue url(http://www.lovelylovesayings.com/images/A-Red-Rose.jpg) repeat top left; width:1000; border:3; height:450; font-size:16"> To fall in love is to create a religion that has a fallible god.<br><br> Jorge Luis Borges </div> <br><br><br><br><div style="background-color:pink; background-attachment:fixed; background-image:url(http://www.lovelylovesayings.com/images/A-Red-Rose.jpg); background-repeat:repeat; background-position-x:top; background-position-y:left; width:1000; border:3; height:450; font-size:16"> background-attachment is fixed.<br><br> My love, you know you are my best friend.<br> You know that I'd do anything for you<br> And my love, let nothing come between us.<br> My love for you is strong and true.<br><br> Sarah McLachlan </div></body></html>

Edited by Ingolme
Advertising
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...