Solved

HTML, how to shorten width

Posted on 2012-04-12
3
448 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

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

685 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