jorginho_monteiro Posted August 21, 2014 Share Posted August 21, 2014 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 Link to comment Share on other sites More sharing options...
niche Posted August 21, 2014 Share Posted August 21, 2014 <div> with black background with <p> inside. You should check out the relevant tutorials at w3schools Link to comment Share on other sites More sharing options...
newseed Posted August 22, 2014 Share Posted August 22, 2014 Remember that <div> and <p> tags are block elements. If you want the background to be the width of the text then you need to apply display:inline; to the css. Link to comment Share on other sites More sharing options...
happycodings Posted August 28, 2014 Share Posted August 28, 2014 (edited) 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 August 28, 2014 by Ingolme Advertising 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