Jump to content

Placement of style in html


vinoman

Recommended Posts

I was having trouble getting a style to work in html.

 

the page is: http://emilydickinson.us/media.html

 

I was given this style to adjust the width that a caption can be have under an image.

 

#lone p, #middlecolumn p {width: 150px;}

 

but I can't seem to figure out how to place the style to make it work.

 

any help would be appreciated. thanks.

Link to comment
Share on other sites

Add it to the bottom of the css file in the css folder

 

css/style.css

 

I placed the style in the middle of the style sheet under the other p style. Does putting it on the bottom of the sheet make a difference? And how do I place it on the html page?

 

is it:

?
Edited by vinoman
Link to comment
Share on other sites

Add it to the bottom of the css file in the css folder

 

css/style.css

 

I placed the style in the middle of the style sheet under the other p style. Does putting it on the bottom of the sheet make a difference? And how do I place it on the html page?

 

is it:

?

 

Still doesn't work.

 

it is in the

tags but it still doesn't stay within the 150px width.

 

what am I doing wrong?

Link to comment
Share on other sites

If you are using this in your css: #lone p, #middlecolumn p {width: 150px;} It is targeting any

elements within an element that has an id of "lone" or "middlecolumn".

 

So, in your code, you'd need to do something like this:

........

I don't believe you can have two ids on the same element like you do now (
).

 

Make sense?

Link to comment
Share on other sites

If you are using this in your css: #lone p, #middlecolumn p {width: 150px;} It is targeting any

elements within an element that has an id of "lone" or "middlecolumn".

 

So, in your code, you'd need to do something like this:

........

I don't believe you can have two ids on the same element like you do now (
).

 

Make sense?

 

I divided the styles into two:

 

#lone p {width: 150px;}

 

#middlecolumn p {width: 150px;}

 

but it still doesn't work. I can't see what else to do!

 

I don't think this style works.

 

Any other clues?

Link to comment
Share on other sites

What you had for the CSS was fine. This is fine: #lone p, #middlecolumn p {width: 150px;}

 

What you can't do is this:

. That gives the div two id's, which isn't allowed. As I said, and Wickham said before me, you need to follow this example:

 

........

 

You need a div with one id only, and within that div, a p element.

Link to comment
Share on other sites

What you had for the CSS was fine. This is fine: #lone p, #middlecolumn p {width: 150px;}

 

What you can't do is this:

. That gives the div two id's, which isn't allowed. As I said, and Wickham said before me, you need to follow this example:

 

........

 

You need a div with one id only, and within that div, a p element.

 

Thanks, I'll try that.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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