tjillian87 Posted February 19, 2016 Share Posted February 19, 2016 Hello everyone on w3schools, I am having trouble with block level elements on my page. I am using a div tag, however, I wanted to create an inline style with double-lined borders and one half of a letter width padding offsetting the text. Also, I am trying to make the block positioned horizontally Link to comment Share on other sites More sharing options...
davej Posted February 20, 2016 Share Posted February 20, 2016 A picture is worth a thousand words. Can you provide a picture of what you want? Link to comment Share on other sites More sharing options...
tjillian87 Posted February 23, 2016 Author Share Posted February 23, 2016 (edited) I wanted a box model like the one in this pdf file. I don't know if you can open it: http://www.gibsonr.com/classes/cop1830/20162/proj3il.pdf Also, how can I get my background image to repeat like that? Edited February 23, 2016 by tjillian87 Link to comment Share on other sites More sharing options...
Ingolme Posted February 23, 2016 Share Posted February 23, 2016 Background images repeat by default, you have to explicitly specify it if you don't want the image to repeat. I saw your PDF, but I don't know what kind of box model you're referring to. Link to comment Share on other sites More sharing options...
tjillian87 Posted February 23, 2016 Author Share Posted February 23, 2016 Well, the real problem is this: 1.)I am creating an block element that uses an inline-style div tag. I like creating horizontal rules because this rule looks better on my rendered page, and the code is simple and easy to remember. However, I am having some difficult clearing the float I have created for the inline-style div-tag. Here is my code thus far: <div style=" border:3px double; width:50%; float:right; padding: 0.5em; margin-bottom:1em;" /> <p> some text</p> <hr style="clear:right;" /> The float doesn't clear, however, and the horizontal rule is included in the block element, and therefore, the div tag. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 23, 2016 Share Posted February 23, 2016 You are self closing the div element so it renders as <div style=" border:3px double; width:50%; float:right; padding: 0.5em; margin-bottom:1em;"> </div> <p> some text</p> <hr style="clear:right;" /> So the paragraph hr element are NOT within div element. 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