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 82885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:41:13+00:00 2026-05-10T21:41:13+00:00

The code I have pasted below is meant to display images on the middle

  • 0

The code I have pasted below is meant to display images on the middle 2 links without text and go back to text on the reset and fourth link. I have set display:none for the span tag only, but it does nothing. Is there anyway to do what I am after simply, without using a framework?

edit: example

<html>     <head>         <style type='text/css'>                 .class1{color:#000; background-image:url('1.jpg');}         .class1 span { display: none;}                 .class2{color:#00f; background-image:url('2.jpg');}         .class2 span { display: none;}                 .class3{color:#0f0; background-image:url('1.jpg');}         .class3 span { display: none;}                 .class4{color:#f00;}          </style>     </head>     <body>         <script type='text/javascript'>                 function sbox(divid, classname)                 {                         document.getElementById(divid).className=classname;                  }         </script>         <div>         <a href='#' onclick='sbox('div1','class1');return false;'>Reset</a><br/>                 <a href='#' onclick='sbox('div1','class2');return false;'>try here</a><br/>                 <a href='#' onclick='sbox('div1','class3'); return false;'>or here</a><br/>                 <a href='#' onclick='sbox('div1','class4');return false;'>or maybe here</a>         </div>         <div id='div1' class='class4'><span id='div1_text'>Blah blah blah</span></div>     </body> </html> 
  • 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. 2026-05-10T21:41:14+00:00Added an answer on May 10, 2026 at 9:41 pm

    The rel attribute is supposed to describe the relationship of the link to the current document. It should have one of the values described here. A DIV is a block-level grouping element, whereas a SPAN is an inline grouping element. SPANs allow you to group text and tags together for some purpose (common styles, etc.) without changing the flow of the markup.

    EDIT: The question changed out from under me so the above seems really disconnected from the current context.

    You need to do as @llandril says and give the DIV some size. I would suggest giving the DIV fixed width and height — either always or when one of the classes that displays an image is used. Use the width and height of your background image if you want the whole thing displayed. You may also need to give it some content as well, but I don’t think so.

    Here is what class1 would look like, I think. I haven’t tested this.

        /* in case color needs to apply to other elements */     .class1 { color: #000; }      div .class1 {         background-image:url('1.jpg');         width: 60px;         height: 30px;     }      div .class1 span { display: none;} 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a plot (sample code pasted below) that I am trying to add
Put it another way: what code have you written that cannot fail. I'm interested
We’ve found that the unit tests we’ve written for our C#/C++ code have really
Code I have: cell_val = CStr(Nz(fld.value, )) Dim iter As Long For iter =
I have code that references a web service, and I'd like the address of
I have code to create another row (div with inputs) on a button click.
I have code similar to this filtering entries in an Array of Objects: var
I have code like this: var newMsg = new Msg { Var1 = var1,
I have code like this: template <typename T, typename U> struct MyStruct { T
I have code similar to the following in many places: var dbParams = db.ReadParams(memberID,

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.