Solved

How to hide <li>?

Posted on 2008-10-23
5
3,043 Views
Last Modified: 2013-11-19
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
Comment
Question by:Abdu_Allah
  • 4
5 Comments
 
LVL 21

Accepted Solution

by:
silemone earned 500 total points
ID: 22786626
change class to style =
0
 
LVL 21

Expert Comment

by:silemone
ID: 22786632
<li id="liItem" class="visibility:hidden" >Item</li>

should be

<li id="liItem" style="visibility:hidden" >Item</li>
0
 
LVL 21

Expert Comment

by:silemone
ID: 22786643
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
 
LVL 82

Expert Comment

by:hielo
ID: 22786653
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
 
LVL 21

Expert Comment

by:silemone
ID: 22786703
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

770 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