Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3067
  • Last Modified:

How to hide <li>?

Hi, I want to hide <li>, I did like this:
<li id="liItem" class="visibility:hidden" >Item</li>
But does not work.
Any ideas?
0
Abdu_Allah
Asked:
Abdu_Allah
  • 4
1 Solution
 
silemoneCommented:
change class to style =
0
 
silemoneCommented:
<li id="liItem" class="visibility:hidden" >Item</li>

should be

<li id="liItem" style="visibility:hidden" >Item</li>
0
 
silemoneCommented:
even better:
instead of visibility, use: display
visibility still leaves the space where the li will later appear
use

<li id="liItem" style="display:none;" >Item</li>
0
 
hieloCommented:
visibility will leave a gap. If you do not want that use the display property instead:
<li id="liItem" style="display:none;">Item</li>

Open in new window

0
 
silemoneCommented:
finally, the explanation:

'class' is used to look for non-inline styles...i.e... class = "theStyles"
then you would have:

<style type="text/css">
.theStyles
{
        //this is where you would place css
}
</style>


'style' is used for inline style i.e.   style="font-size:20; color:blue;"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now