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

  • Home
  • SEARCH
  • 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 8692407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:18:29+00:00 2026-06-13T00:18:29+00:00

Jsfiddle: http://jsfiddle.net/87YGW/ At present I have to click tab 1 to show content however

  • 0

Jsfiddle: http://jsfiddle.net/87YGW/

At present I have to click tab 1 to show content however I want tab 1 content to display automatically upon opening the page.

HTML:

<div id="tab2" class="css-tabs">
        <ul class="noint11_menu">
            <li id="item-1"> <a href="#item-1">Tab 1</a>
                <div>tab conten1
                   </div>
            </li>
            <li id="item-2"> <a href="#item-2">Tab 2</a>
                <div>
                    <p>Tab Content 2</p>
                </div>                
            </li>
            <li id="item-3"> <a href="#item-3">Tab 3</a>
                <div id="notice">
                    <p>tab content 3 </p>
                </div>
            </li>
            <li id="item-4" title="click for Tab 4"> <a href="#item-4">Tab 4</a>
                <div>
                    <p>Tab Content 4</p>
                </div>
            </li>
        </ul>
    </div>​

CSS:

.css-tabs {
    position: relative;
    text-align: left; /* This is only if you want the tab items at the center */
    height: auto
}
.css-tabs ul.noint11_menu {
    list-style-type: none;
    display: inline-block; /* Change this to block or inline for non-center alignment */
}
.css-tabs ul.noint11_menu > li {
    display: block;
    float: left;
}
.css-tabs ul.noint11_menu li > a {
    color: #EEEEEE;
    text-shadow: 1px 1px 1px #000;
    font-family: 'MuliLight', Arial, sans-serif;
    font-size: 14px;
    text-decoration: none;
    display: block;

}
.css-tabs ul.noint11_menu li > div {
    display: none;
    position: absolute;
    width: 100%;

}
.css-tabs ul.noint11_menu li > div > p {
    border: transparent;
    padding: 10px;
    margin: 0;
}
.css-tabs ul.noint11_menu li > a:focus {
    border-bottom: 1px solid #fff;
}
.css-tabs ul.noint11_menu li:target > a {
    cursor: default;
    border-bottom: 1px solid #fff;
}
.css-tabs ul.noint11_menu li:target > div {
    display: block;
}​

I cannot use Javascript, Jquery or iframe

  • 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-13T00:18:30+00:00Added an answer on June 13, 2026 at 12:18 am

    I cannot demo it in the fiddle (because iframe), but if you link to the first tab directly, eg: http://www.yoururl.com/page#item-1, the first tab’s content will be visible on page load.

    You can test this by putting all your code inside a new blank html file (CSS and markup in their correct places) and saving it as “test.html”. Then make another html file inside the same folder with this code:

    <html>
      <body>
        <a href="test.html#item-1">link</a>
      </body>
    </html>
    

    Save and open the second file and click the link to go to your styled page. Note the first tab’s content is visible, and tab switching still works as expected.

    Without JS to redirect or to change the window location, I don’t believe you can get the same result through CSS alone.

    This article explains why it works: The :target pseudo selector in CSS matches when the hash in the URL and the id of an element are the same.


    edit to add another hacky, but pure CSS “solution”:

    Make the first tab always visible with #item-1 div {display: block}, and set a background colour on all tabs:

    .css-tabs ul.noint11_menu li > div {
        display: none;
        position: absolute;
        width: 100%;
        left: 0;
        color: #ccc;
        text-align: left;
        padding: 0;
        margin-left: 32px;
        background: #fff; /* added this */
    }
    

    Now the other tabs will hide the first tab when they are selected. demo: http://jsfiddle.net/87YGW/3/

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

Sidebar

Related Questions

jsfiddle: http://jsfiddle.net/PBvk9/ I want the arrow for its respective tab to show up only
With the following jsFiddle: http://jsfiddle.net/Kb7Fp/ How would I show the content with an animation
I have this jsFiddle: http://jsfiddle.net/HMZuh/1/ Which contains this html <div ng-app ng:controller=ShowHideController> <div ng-show='showMe'>
i have this jsfiddle http://jsfiddle.net/danieltulp/gz5gN/ what i want to do is fiter a unordered
In this JSFiddle http://jsfiddle.net/JQ6qF/ have I striped down the problem. Try click on Save
Here is the jsFiddle: http://jsfiddle.net/8dbQu/1/ In brief, I have such structure: <div class='content'> <div
I have the following jsfiddle: http://jsfiddle.net/rpp6s/ I want to alert the value of the
Here is the jsfiddle : http://jsfiddle.net/hhimanshu/sYLRq/ Current Click on Add to list and drop-down
Hi I have setup the following jsFiddle http://jsfiddle.net/a9ugu/2/ I am wondering why I get
Have a look at this jsfiddle: http://jsfiddle.net/Dh96F/1/ The Expand button will animate the widening

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.