Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPaul Jackson
8,943 PointsHorizontal Rule <hr>
Can you adjust the width of the horizontal rule?
4 Answers
Paul Jackson
8,943 PointsThanks for the quick reply. No, I haven't tried, I am watching the HTML videos and just was curious. How would you do it?
Jeremy Castanza
12,081 PointsPaul, this is a little bit more advanced... but typically you'd have a horizontal rule in a containing element such as a section or div - meaning that you typically wouldn't need to define the width of the horizontal rule itself. By defining the width of the containing element, the width would automatically be applied to the horizontal rule. It's something that's covered more in the realm of CSS.
Try not to get into the habit of defining widths for every element - it's a easy thing to do as a beginner and it causes a lot of heartburn later on as you become a more experienced web designer (i.e. rookie mistake). Once you learn CSS, this advice will make much more sense.
notf0und
11,940 PointsYou should be able to. Is it not working for you?
Paul Jackson
8,943 PointsCool beans. Thanks a lot!
notf0und
11,940 Pointsnotf0und
11,940 PointsYou'd do
You can do more with it as well, such as the height, colour, borders, etc. Google around, and test it out in CSS :)