Solved

HTML, how to shorten width

Posted on 2012-04-12
3
443 Views
Last Modified: 2012-04-12
I have the following code:

<html>
<body>
<hr />
<p>Line 1<br />
Line 2<br />
Line 3<br />
<a href="http://www.google.com">
This is a link</a>
</p>
<hr />
</body>
</html>

Open in new window


Notice the horizontal lines

I would like to shorten the width of this to around 30 percent of the page (or maybe just slightly longer than the longest line

How would I do that

Thanks
0
Comment
Question by:Los Angeles1
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Ashok earned 334 total points
ID: 37839351
Try

<html>
<body>
<hr width='70%'/>
<p>Line 1<br />
Line 2<br />
Line 3<br />
<a href="http://www.google.com">
This is a link</a>
</p>
<hr width='70%'/>
</body>
</html>

HTH
Ashok
0
 
LVL 13

Assisted Solution

by:Ashok
Ashok earned 334 total points
ID: 37839357
If you want to align hr to left, use

<html>
<body>
<hr width='70%' align='left'/>
<p>Line 1<br />
Line 2<br />
Line 3<br />
<a href="http://www.google.com">
This is a link</a>
</p>
<hr width='70%' align='left'/>
</body>
</html>

HTH
Ashok
0
 
LVL 17

Assisted Solution

by:bigeven2002
bigeven2002 earned 166 total points
ID: 37839364
Just to clarify, are you wanting to reduce the <hr> by 30% or making it only 30% long.  If the former, then Ashok's solution should work, otherwise change it to
<hr width="30%" />

Open in new window

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now