Solved

HTML, how to shorten width

Posted on 2012-04-12
3
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
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 embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

635 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