Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9195753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:41:52+00:00 2026-06-17T21:41:52+00:00

I have the following code. Jfiddle is here . As seen, the bottom borders,

  • 0

I have the following code. Jfiddle is here. As seen, the bottom borders, what resemble <HR> tags extend the entire length of the page.

I would like to limit the borders of <h1> and <h2> tags to be only 30% of the page. While <h3> tags remain extending across the entire page. Is this possible with css?

EDIT: with a follow up question, how would I change the css on the <h3> tag so that under the border is roughly one line of white space the same size of the font as <h3>?

HTML

<HTML>
    <HEAD>
        <TITLE>Sample Wiki Page</TITLE>
        <link rel='stylesheet' type = 'text/css' href = 'default.css' />
    </HEAD>
    <BODY>
        <DIV id='content'>
            <h3>Main Title</h3>
            <h2>Sub Title</h2>
                <p>
                     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eros odio, venenatis ut suscipit eget, vestibulum id est. Vivamus aliquet lacus sit amet enim tempus in fermentum ipsum ornare. Pellentesque tincidunt orci sed sem luctus tristique. Ut a turpis ac nisi semper luctus. Nulla mattis ornare augue, vel lacinia purus porta eu. Vestibulum pulvinar justo dolor, in ultricies tellus. Nullam semper, ante at feugiat commodo, neque eros pulvinar ante, et porttitor velit orci eu magna. Duis mattis libero vitae magna lacinia tincidunt. Vivamus placerat elit a nisi ultrices elementum. Vestibulum condimentum posuere nulla, id ornare urna mattis id. Quisque ornare risus diam. Nunc malesuada leo sit amet mauris bibendum pharetra. Integer convallis orci id lorem volutpat suscipit.

                    Vestibulum ac magna libero, non condimentum neque. Integer vestibulum, quam at tempus fermentum, mi odio dictum nibh, quis venenatis velit ligula laoreet massa. Fusce lobortis augue eu ante bibendum consequat eget posuere neque. Mauris dui lorem, fringilla et auctor a, eleifend id nisi. Sed nunc tortor, blandit et malesuada quis, posuere pellentesque lorem. Nunc vehicula lectus eget tortor tempus sed pharetra diam luctus. Aenean odio leo, accumsan a vestibulum ut, tincidunt in mi. Curabitur commodo venenatis dolor, ultrices placerat nibh tempor nec. Duis eget odio mi, id imperdiet lectus. Aenean luctus bibendum arcu non egestas.
                </p>
            <h2>Code Section</h2>
            <pre>
                <xmp>
<HTML>
    <HEAD>
        <TITLE>Sample Wiki Page</TITLE>
        <link rel='stylesheet' type = 'text/css' href = 'default.css' />
    </HEAD>
    <BODY>
        <h3>Main Title</h3>
        <h2>Sub Title</h2>
             Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eros odio, venenatis ut
             suscipit eget, vestibulum id est. Vivamus aliquet lacus sit amet enim tempus in fermentum 
             ipsum ornare. Pellentesque tincidunt orci sed sem luctus tristique. Ut a turpis ac nisi 
             semper luctus. Nulla mattis ornare augue, vel lacinia purus porta eu. Vestibulum pulvinar 
             justo dolor, in ultricies tellus. Nullam semper, ante at feugiat commodo, neque eros 
             pulvinar ante, et porttitor velit orci eu magna. Duis mattis libero vitae magna lacinia 
             tincidunt. Vivamus placerat elit a nisi ultrices elementum. Vestibulum condimentum posuere 
             nulla, id ornare urna mattis id. Quisque ornare risus diam. Nunc malesuada leo sit amet 
             mauris bibendum pharetra. Integer convallis orci id lorem volutpat suscipit.

            Vestibulum ac magna libero, non condimentum neque. Integer vestibulum, quam at tempus 
            fermentum, mi odio dictum nibh, quis venenatis velit ligula laoreet massa. Fusce lobortis 
            augue eu ante bibendum consequat eget posuere neque. Mauris dui lorem, fringilla et auctor 
            a, eleifend id nisi. Sed nunc tortor, blandit et malesuada quis, posuere pellentesque lorem
            . Nunc vehicula lectus eget tortor tempus sed pharetra diam luctus. Aenean odio leo, 
            accumsan a vestibulum ut, tincidunt in mi. Curabitur commodo venenatis dolor, ultrices 
            placerat nibh tempor nec. Duis eget odio mi, id imperdiet lectus. Aenean luctus bibendum 
            arcu non egestas.
        <h2>Code Section</h2>
        <pre>
        </pre>
    </BODY>
</HTML>
            </xmp>
            </pre>
        </DIV>
    </BODY>
</HTML>

CSS

#content pre {
    padding: 1em;
    border: 1px dashed #2f6fab;
    color: black;
    background-color: #f9f9f9;
    white-space: pre;
    margin: 1em 0px;
    display: block;
    font-family: monospace,Courier;
    line-height: 1.1em;
    width:70%;
}

#content h3{
    font-size: 188%;
    line-height: 1.2em;
    color: black;
    background: none;
    font-weight: normal;
    margin: 0;
    overflow: hidden;
    padding-top: .5em;
    padding-bottom: .17em;
    border-bottom: 1px solid #aaa;
}
#content h1, h2 {
    color: black;
    background: none;
    font-weight: normal;
    margin: 0;
    overflow: hidden;
    padding-top: .5em;
    padding-bottom: .17em;
    border-bottom: 1px solid #aaa;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:41:53+00:00Added an answer on June 17, 2026 at 9:41 pm

    You can use width: 30% for your first question, and margin-bottom: 1.2em for your second.

    Here is your fiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code on my page. http://jsfiddle.net/SO_AMK/r7ZDm/ As you see it's a
I have the following code with custom directive 'my-repeater': <div ng-controller=AngularCtrl> <div my-repeater='{{items}}'>Click here</div>
I have put the following code here I am having issues with my boxes
I have the following Code var page = '<h1>Hello!</h1><p>FOO</p><span class=username>this is ur name</span><p>sample text</p>';
I have the following basic code, here is the jsfiddle: http://jsfiddle.net/fLZKc/ <div id=menu> <ul>
I have the following code that works as shown here: http://jsfiddle.net/rBd53/12/ HTML/JS code in
I have used the following code to get click outside to close working: Here
I'm using knockoutjs version 2.2.0 and have the following situation: Javasript Code Here is
I have a following layout of my web page. Following CSS code gives me
I have the following jQuery code which locates the ul element on the page,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.