Removing bullets from asp.net menu - html

I can't seem to get rid of bullets in my menu. Can anyone help me?
Master page code:
<asp:Menu ClientIDMode="Static" ID="main_menu" runat="server" Orientation="Horizontal">
<StaticItemTemplate>
<div class="nav_style">
<asp:Label runat="server" Text='<%# Eval("Text") %>' />
</div>
</StaticItemTemplate>
<Items>
<asp:MenuItem NavigateUrl="~/home.aspx" Text="home" />
<asp:MenuItem NavigateUrl="~/what-it-can-do.aspx" Text="what it can do" />
<asp:MenuItem NavigateUrl="#" Text="pricing" />
<asp:MenuItem NavigateUrl="#" Text="news & events" />
<asp:MenuItem NavigateUrl="#" Text="partner with us" />
</Items>
</asp:Menu>
Here is my CSS code:
.nav_style
{
list-style-type:none;
background-color:#242C32;
border-radius:3px;
color:#F5F5F5;
border-top:6px solid #242C32;
border-bottom:6px solid #242C32;
border-left:12px solid #242C32;
border-right:12px solid #242C32;
font:13px calibri;
}
Here is the generated HTML:
<div id="main_menu">
<ul class="level1">
<li><a class="level1 selected" href="home.aspx">
<div class="nav_style">
<span>home</span>
</div>
</a></li><li><a class="level1" href="what-it-can-do.aspx">
<div class="nav_style">
<span>what it can do</span>
</div>
</a></li><li><a class="level1" href="#">
<div class="nav_style">
<span>pricing</span>
</div>
</a></li><li><a class="level1" href="#">
<div class="nav_style">
<span>news & events</span>
</div>
</a></li><li><a class="level1" href="#">
<div class="nav_style">
<span>partner with us</span>
</div>
</a></li>
</ul>
</div>
EDIT
Not any of the answers seems to be working for me, any other suggestions? Thank you.

Managed to do it myself. In my css file there was a background set for bullets for the whole page
background:url('../img/blue_bullet.png')
so I added to my css
.nav_style li
{
background:none;
}

Redefine the css style as:
.nav_style ul
{
...
}
Remove nav_style class from the div. Instead use CssClass = "nav_style" in the Menu markup.

FYI, just came on this and nothing mentioned worked. Examining the rendered html shows that a table cell was being appended to my list item (the whole menu is a table rendered structure) and using a bullet icon as a background image from webkit. To override that, specify your own bullet, which in my case, was nothing. So I made a 2x2px white png file and specified the "static pop up image url" (StaticPopoutImageURL) control property which is used as the bullet cell's background. The following is in the menu control layout code:
<asp:Menu ID="MyMenu" runat="server"
DisappearAfter="100"
StaticDisplayLevels="1"
Orientation="Vertical"
StaticPopoutImageURL="/Images/White2x2px.png"
CssClass="my anchor/ul styles">
.....
</asp:Menu>
Hopes this helps someone since I couldn't find the answer anywhere.
Jim

Try this:
#main_menu ul
{
list-style:none;
}

Try this to reset it with css:
#main_menu *
{
list-style: none;
}
Demo

For your generated HTML, the following block should get you rid of the bullets.
.level1
{
list-style:none;
}
A more generic way is to target the generated <ul> with something like the following:
#main_menu ul
{
list-style:none;
}
A working example: http://jsfiddle.net/U2Vgf/1/

Related

How do I move this icon/button? CSS?

I'm just learning asp.net, VB, SQL and CSS. I am writing a dating site and want the "likes" icon to sit next to the other 3 centralised icons just above it. The first 3 icons are simply images at the moment but the Likes icon is in DIVS and does function correctly but ends up on the row below even though there's plenty of space to fit it next to them. Many thanks for any help...
<asp:Image ID="Imagelove" runat="server" width="90px" ImageUrl="~/files/images/loveicon.png" />
<asp:Image ID="ImageGift" width="90px" runat="server" ImageUrl="~/files/images/gift.png" />
<asp:Image ID="ImageReport" width="90px" runat="server" ImageUrl="~/files/images/report.png" />
<div style="width:90px; height:89px; position:relative; background: url('/files/images/likebutton.png'); cursor: pointer;" onClick="addLike('<%# Eval("orderID")%>')">
<div style="font-size:12px; color:#000; background:#ffffff; border:1px solid #000; padding:0 3px; float:left; margin: 0px 0 0 55px;" id="<%# Eval("orderID")%>"><%# Eval("likeCounter")%>
</div>
</div>
I have found the solution myself thank you. I added display: inline-block; in to the DIV Style="" part.

ASP Menu float property is not working

I have an asp menu, I want to float it to left so the element after it can come to its right side (beside) it. I've set a CssClass for the Menu and added float: leftto it, but it is not working. I've even changed the float:left to float:right to see if it will work or not, but nothing worked.
Here is my code:
<form id="form1" runat="server">
<div class="wrapper">
<div class="navbar">
/*some code*/
</div>
<div class="middle">
<asp:Menu ID="MenuRec" runat="server" CssClass="recFriends">
<Items>
<asp:MenuItem Text="People you may know:" Selectable="false" Enabled="false"></asp:MenuItem>
<asp:MenuItem Text="<br/>" Selectable="false" Enabled="false"></asp:MenuItem>
</Items>
<Items>
<asp:MenuItem Text=" Item1" Selectable="false"></asp:MenuItem>
<asp:MenuItem Text=" Item2" Selectable="false"></asp:MenuItem>
<asp:MenuItem Text=" Item3" Selectable="false"></asp:MenuItem>
</Items>
</asp:Menu>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
<!--here goes the customized content-->
</asp:ContentPlaceHolder>
</div>
<div class="footer">
</div>
</div>
</form>
</body>
My CSS:
.recFriends {
float:left;
padding-top:1em;
color:#003366;
font-weight:normal;
font-style:italic;
}
controls inside the ContentPlaceHolder (which will be in a page that inherits from this master page) must come to the right of the menu, but these are coming below it instead.
I've searched a lot, but nothing worked, I've even checked the solutions available here:
CssClass is not working for my asp menu - all code attached
asp Menu control not floating properly
Can anyone tell me how to solve this problem?
Thank you.
Wrap your menu in a div and close the div before the content place holder. Move your CSS class from the menu to the container div.
HTML
<div class="recFriends">
<asp:Menu ID="MenuRec" runat="server">
<Items>
<asp:MenuItem Text="People you may know:" Selectable="false" Enabled="false"></asp:MenuItem>
<asp:MenuItem Text="<br/>" Selectable="false" Enabled="false"></asp:MenuItem>
</Items>
<Items>
<asp:MenuItem Text=" Item1" Selectable="false"></asp:MenuItem>
<asp:MenuItem Text=" Item2" Selectable="false"></asp:MenuItem>
<asp:MenuItem Text=" Item3" Selectable="false"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
<asp:ContentPlaceHolder ID="MainContent" runat="server">
<!--here goes the customized content-->
</asp:ContentPlaceHolder>
CSS
.recFriends {
float: left;
padding-top: 1em;
color: #003366;
font-weight: normal;
font-style: italic;
width: 20%;
padding-left: 2em;
}

How can vertical align bottom and top at the same time?

I want to vertical align some elements at the top of the td element and some other elements to be at the bottom of td element .
this is my code :
<ItemTemplate>
<td runat="server" style="position:relative;vertical-align:top;">
<a runat="server" href='#' class="Up">
</a>
<br />
<asp:Label ID="ProductNameLabel" CssClass="Up"/>
<br />
<asp:Label ID="SummaryLabel" CssClass="Up"/>
<br />
<asp:Label ID="PriceLabel" CssClass="Down" />
<br />
<a runat="server" href="#" class="Down">
</a>
<br />
<asp:Button ID="Button1" CssClass="Down" />
</td>
</ItemTemplate>
The elements from the "Up" class i want to be displayed at the top of the td and the elements in the "Down" class at the bottom of the td .
i tried this css :
.Up {
top:0px;
}
.Down {
bottom:0px;
}
And it didn't work . Can someone help me find the solution ?
It would help if you only provided HTML and CSS in your example.
In any case, I think what you are looking for is position:absolute
.Up {
position:absolute;
top:0;
}
.Down {
position:absolute;
bottom:0;
}
This will position them relative to the first parent that has a position:relative on it.
Note, I also removed the px from your 0 as it's not necessary to specify that when the value is 0. 0em = 0px = 0% = 0
Here is a more complete example.

Programmatically removing CSS class files - jQuery

I am using the jQueryUI library to take advantage of tabs on my page and the CSS styles of the tabs are being applied to the content within the div tags.
When I use the Chrome Developer tools I have narrowed it down to the following CSS classes in in the jquery-ui.css class:
.ui-widget {
/*font-family: Verdana,Arial,sans-serif;*/
font-size: 1.1em/*{fsDefault}*/;
}
.ui-widget .ui-widget {
font-size: 1em;
}
How do I remove these CSS styles from my div content containers. I tried the following jQuery snippet and it did not work.
$("#nameSearch").removeClass("ui-widget");
Here is a snippet of my HTML page:
<div id="searchTabs">
<ul>
<li>Name</li>
<li>Case Number</li>
</ul>
<div id="nameSearch">
<b>First Name:</b> <asp:TextBox ID="txtFirstNameSearch" runat="server" CssClass="txt" /><br />
<b>Last Name:</b> <asp:TextBox ID="txtLastNameSearch" runat="server" CssClass="txt" /><br />
<b>Date of Birth:</b> <asp:TextBox ID="txtDateOfBirth" runat="server" CssClass="txt" /><br />
</div>
<div id="caseNumberSearch">
<b>Case Number:</b> <asp:TextBox ID="txtCaseNumberSearch" runat="server" CssClass="txt" /><br />
</div>
</div>
If you know the position of those CSS rules, then:
IE
document.styleSheets[0].removeRule(i);
//i = position of the rule.
Other Browsers
document.styleSheets[0].deleteRule(i);

How to vertically center images within an LI element?

I am using jQuery mobile and I am trying to center some image icons within a list. The problem I am having is that the images are not vertically centered within a list item.
Can someone kindly point me in the right direction since I am not a CSS expert by far. I know I can get them using tables but I do not want to do that. Thanks.
Oh and I am using EJS in the code below. Please see the screenshot:
Here is my code:
<li data-icon="false">
<a href="#">
<img src="images/img_trans.gif" class='largePlatform platform_<%= releases[i].platform_abbr %>_large' width='30' height='30' style="position:absolute; top:25%; left:10px"/>
<h2 style="position:absolute; top:25%; left:50px"><%= releases[i].platform_abbr %></h2>
<div data-role="controlgroup" data-type="horizontal" style="float:right" >
<% if (purchaseText != "") { %>
<img src="images/game_detail/<%= releases[i].purchase_button_icon %>-purchase.png" width="35" height="35" onclick="window.open('<%= releases[i].purchase_button_url %>');" alt="<%= purchaseText %>" style="position:relative; top:10px;"/>
<% } %>
<div data-role="button" data-icon="reminder" data-theme="<%= buttonTheme %>" onclick="<%= buttonAction %>(<%= releases[i].id %>)">
<%= buttonText %>
</div>
</div>
</a>
</li>
Live Example:
http://jsfiddle.net/B6Z9N/
HTML
<li>
<img src="http://dummyimage.com/20x20/000/000000.png" />
</li>​
CSS
li {
border: 1px dotted black; /* Just to illustrate height */
height: 100px;
line-height: 100px;
vertical-align: middle;
}​
Found this article: http://css-tricks.com/snippets/css/absolute-center-vertical-horizontal-an-image/
I know I'm late to the party but I always use this and thought someone might find it useful.
HTML:
<ul>
<li class="logo_bar"><img src="img/1" /></li>
<li class="logo_bar"><img src="img/2" /></li>
<li class="logo_bar"><img src="img/3" /></li>
<li class="logo_bar"><img src="img/4" /></li>
<li class="logo_bar"><img src="img/5" /></li>
</ul>
CSS:
.logo_bar {
display: inline-block;
vertical-align: middle;
}
Just apply margin on img.
<li>
<img class="image-style" src="https://dummyimage.com/20x20/000/111fed" />
</li>
.image-style {
margin : 10px -10px;
}
li {
border : 1px solid black
}
JSFiddle