vinoman Posted December 2, 2009 Report Share Posted December 2, 2009 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. Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted December 2, 2009 Report Share Posted December 2, 2009 Add it to the bottom of the css file in the css folder css/style.css Quote Link to comment Share on other sites More sharing options...
vinoman Posted December 2, 2009 Author Report Share Posted December 2, 2009 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: ? Quote Link to comment Share on other sites More sharing options...
Wickham Posted December 2, 2009 Report Share Posted December 2, 2009 (edited) It probably won't matter where you place the style in the stylesheet, as long as it's after the p style. In the html markup you need ........ Edited December 2, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
vinoman Posted December 2, 2009 Author Report Share Posted December 2, 2009 (edited) 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 December 2, 2009 by vinoman Quote Link to comment Share on other sites More sharing options...
vinoman Posted December 2, 2009 Author Report Share Posted December 2, 2009 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? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 2, 2009 Report Share Posted December 2, 2009 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? Quote Link to comment Share on other sites More sharing options...
vinoman Posted December 2, 2009 Author Report Share Posted December 2, 2009 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? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 2, 2009 Report Share Posted December 2, 2009 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. Quote Link to comment Share on other sites More sharing options...
vinoman Posted December 2, 2009 Author Report Share Posted December 2, 2009 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. Quote Link to comment Share on other sites More sharing options...
vinoman Posted December 2, 2009 Author Report Share Posted December 2, 2009 (edited) I finally got it working. Thanks http://emilydickinson.us/media.html Edited December 2, 2009 by vinoman Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.