Jump to content

Div tag problems


tjillian87

Recommended Posts

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

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

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

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
×
×
  • Create New...