Selected menu Highlight ASP.Net Web Forms - css

I have this code on my TruckData page:
<!-- BEGIN SIDEBAR -->
<div class="left side-menu" style="background: #99CCFF">
<div class="body rows scroll-y" style="background: #99CCFF; margin-top: 50px; padding-top: 40px">
<!-- Sidebar menu -->
<div id="sidebar-menu">
<ul>
<li>
<asp:HyperLink ID="hyperlink_TruckData" runat="server" Text="Truck Data" NavigateUrl="~/View/TruckData.aspx" Font-Underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-info-sign" style="color:black; background: #E8D73E"></i>
Truck Data</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="hyperlink_MaintenanceRecord" runat="server" NavigateUrl="~/View/MaintenanceRecord.aspx" Font-Underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-info-sign" style="color:black"> </i>
Maintenance Record</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="hyperlink_MaintenanceSchedule" runat="server" Text="Maintenance Schedule" NavigateUrl="~/View/MaintenanceSchedule.aspx" Font-Underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-calendar" style="color:black"> </i>
Maintenance Schedule </asp:HyperLink>
</li>
<li>
<asp:hyperlink id="hyperlink_Inspection" runat="server" text="inspection" navigateurl="~/view/inspection.aspx" font-underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-calendar" style="color:black"></i>
Inspection </asp:hyperlink>
</li>
</ul>
</div><!-- End div #sidebar-menu -->
</div><!-- End div .body .rows .scroll-y -->
</div>
<!-- END SIDEBAR -->
And this is my CSS:
.row a:hover {
background-color: #6699FF;
}
.row a:active {
background-color: #;
}
.row a:visited {
background-color: #;
}
.row a:selected {
background-color: #63D130;
}
This is the output:
On the picture, only the glyphicon is highlighted. I want to highlight the whole. How can I highlight the whole Truck Data menu? In normal HTML it worked, but in ASP.Net, only the icon is highlighted.

Related

What is causing these huge gaps?

I am trying to display several items from a query onto this page. I am trying to make them so that 6 images are on a line and evenly spaced. However, it seems that no matter how I change the css, I still keep ending up with huge gaps in some places.
Here is the code I used to create this section:
<div class="container2">
<div class="category"><h2>All Items</h2></div>
<div class="display">
<?php do { ?>
<ul>
<li><a href="details.php?recordID=<?php echo $row_Master['Master_ID']; ?>"><img class="thumb" src="img/<?php echo $row_Master['Img']; ?>"/>
<br />
<?php echo $row_Master['Name']; ?></a></li>
</ul>
<?php } while ($row_Master = mysqli_fetch_assoc($Master)); ?>
<!-- end .display --></div>
<?php
mysqli_free_result($Master);
?>
<!-- end .container2 --></div>
and the CSS associated with it:
.container2 {
margin:0 auto;
text-align: center;
width:95%;
background-color:#FFFFFF;
}
.display{
width:100%;
margin-left:auto;
margin-right:auto;
text-align:center;
overflow:hidden;
}
.display ul li {
float:left;
max-width:15.67%;
margin: 0 0 8% 1%;}
.display ul{
list-style:none;
}
img.thumb {
border:0;
max-height:150px;
min-width:16.67%;
vertical-align:middle;
padding:3px;}
Can anyone help me remove these huge gaps, plz?
Flexbox for the win.
You can get six across wrapping rows with this config. The flex container gets:
display: flex;
flex-wrap: wrap;
And the flex items get:
flex: 0 0 16.666%;
I added several comments in the CSS to explain what I did here. This approach takes a bit of practice but once you get it you will never use floats for layout again.
Here is a great resource that explains the flexbox approach really well: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
* { box-sizing: border-box; }
.display {
border: 2px solid red; /* just for demo visibility */
}
.display ul {
/* ul reset */
list-style: none;
padding: 0;
margin: 0;
/* flexbox layout - flex container config */
display: flex;
flex-wrap: wrap;
}
.display ul li {
border: 2px solid dodgerblue; /* just for demo visibility */
padding: 10px; /* use padding to create spacing between items, remove the borders to get the final look */
/* flex item config */
flex: 0 0 16.66%; /* 100 divided by 6 is 16.666... */
}
.display ul li span {
display: block;
text-align: center;
}
.display ul li img {
max-width: 100%;
height: auto;
}
<div class="container2">
<div class="category">
<h2>All Items</h2>
</div>
<div class="display">
<ul>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 1</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 2</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 3</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 4</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 5</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 6</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 7</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 8</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 9</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 10</span>
</a>
</li>
</ul>
</div>
</div>

DDSmoothmenu not working with keyboard (arrow key)

ddsmoothmenu not working with arrow keys on the keyboard.
when li list is so long this goes below the page so unable to click on li. So how do I handle this issue?
ddsmoothmenu.init({
mainmenuid: "divMenu", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
<div align="left" id="tdmenu">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="75%">
<div id="divMenu" class="ddsmoothmenu">
<ul>
<li>
Home
</li>
<asp:Literal runat="server" ID="ltMenu"></asp:Literal>
<li runat="server" id="divProSupportTicket" visible="false">
<a href="javascript:showWindow('supportticket.aspx',900,600,100)">
<img src="images/support.png" alt="Software Support Form" height="20" title="Software Support Form" />
</a>
</li>
<li>
<div id="HelpIcon" style="border: solid 1px gray; background-color: #4C83F8; border-radius: 50%; cursor: pointer; width: 25px; margin-left: 10px; margin-top: 2px;" title="Help Information" onclick="showHelp('home_Vehicle');">
<span style="font-size: 20px; color: White; font-weight: bold; padding: 0px 7px 0px 7px;">
<i>i</i>
</span>
</div>
</li>
<li runat="server" id="liCompanyContacts" visible="false"></li>
</ul>
</div>
</td>
</tr>
</table>
</div>

css add a splitline between two div [duplicate]

This question already has answers here:
Separators for Navigation
(9 answers)
Closed 5 years ago.
Hi I'm trying to put a splitline between the tab "Home" and "Cart" and the tab "Help" and "Contact".
.tab-separator {display: inline-block;
padding-right: 5px;
border-right-style: solid;
border-right-width: thin;
border-right-color: red;
height: 10px;
}
<div class="tab-separator">
<div class="tab-menu" id="tab" style="display: inline-block;">
Home
</div>
</div>
<div class="tab-menu" id="tab1" style="display: inline-block;">
Cart
</div>
<div class="tab-separator">
<div class="tab-menu" id="tab2" style="display: inline-block;">
<a href="#">
Help
</a>
</div>
</div>
<div class="tab-menu" id="tab3" style="display: inline-block;">
Contact
</div>
I tried to do so by displaying the border right of the div that surrounds the div tab. But I have a problem I don't manage to move the splitline as I wish. I want it to not be so high, but if I set a margin top it doesn't work, it will move every tabs.
So what I want is the splitline to be a little lower, maybe 2 pixels lower.
You can put "|" easily with UL LI
ul li {
display: inline-block;
}
ul li:not(:last-child):after {
content: "|";
}
<ul class="standard-nav visible-lg">
<li><a id="intro-linker" class="scroll" href="#intro">Start a fire</a>
</li>
<li><a id="about-linker" class="scroll" href="#ourfires">Our fire</a>
</li>
<li><a id="services-linker" class="scroll" href="#pastfires">Past fires</a>
</li>
<li><a id="team-linker" class="scroll" href="#team">Chief fire lighter</a>
</li>
<li><a id="portfolio-linker" class="scroll" href="#seriesfires">Series of fires</a>
</li>
<li><a id="contact-linker" class="scroll" href="#contact">Get fired up</a>
</li>
</ul>
this can easily be done using border-right, like this :
.right_separator{
border-right: 1px solid;/*This will add a border for the right of the element*/
padding-right: 3px;
}
<div class="tab-menu right_separator" id="tab" style="display: inline-block;">
<a href="#">
Home
</a>
</div>
<div class="tab-menu right_separator" id="tab1" style="display: inline-block;">
<a href="#">
Cart
</a>
</div>
<div class="tab-menu right_separator" id="tab2" style="display: inline-block;">
<a href="#">
Help
</a>
</div>
<!-- Don't add .right_separator for the last element-->
<div class="tab-menu" id="tab3" style="display: inline-block;">
<a href="#">
Contact
</a>
</div>

Make content stretch with sidebar

Before I start I will categorically state I have searched for an answer both here and on Google but no solutions have worked for me. I have tried display: table-cell, inline-block, all types of overflow but nothing is working.
My sidebar will 99% of the time be longer than the content. I would just set a min-height, however I have 3 different sidebars depending on what user is logged in. One is about 4 x longer than the other 2, so setting heights wouldn't work.
<div class="container">
<?php include ('sidebar.php'); ?>
<div class="content">
content
</div>
</div>
My CSS currently:
.container {
width: 1210px;
background: #<?php echo $contentbgcolor; ?>; /* content bg colour */
margin-left: auto;
border-bottom: 1px solid #000;
border-right:1px solid #000;
border-left:1px solid #000;
margin-right: auto;
overflow: auto;
}
.content {
padding: 10px;
float:left;
}
.sidebar {
width: 250px;
overflow: auto;
position: absolute;
float:left;
padding: 10px 0px 0px 10px;
}
Would appreciate any assistance.
Full HTML example:
<div class="container">
<div class="sidebar">
<!-- Time Sidebox -->
<div class="sidebarBoxHeader">
Metropolis Time
</div>
<div class="sidebarBox">
<div id="clock" style="text-align:center; font-weight: bold; font-size: 18px;"></div><div style="text-align:center;">Sunday 5th April</div>
</div>
<!-- End time sidebox -->
<!-- Current game sidebox -->
<div class="sidebarBoxTitle">
Current Game(s)
</div>
<div class="sidebarBox" align="center">
<div align='center'>No games currently.</div>
<div style="margin-top: 10px;"><i class="fa fa-external-link"></i> View today's schedule</div>
</div>
<!-- end current game box -->
<!-- Current game sidebox -->
<div class="sidebarBoxTitle">
Staff on Duty
</div>
<div class="sidebarBox" align="center">
<div align='center'>No staff on duty.</div><div style="margin-top: 10px;"><i class="fa fa-external-link"></i> View full staff roster</div>
</div>
<!-- end current game box -->
<!-- Start Links Sidebox -->
<div class="sidebarBoxTitle">
Dashboard
</div>
<div class="sidebarBox borderBottom">
<ol style="list-style: none; display: inline; -webkit-padding-start: 0px;">
<li><i class="fa fa-home"></i> Admin Home</li>
<li><i class="fa fa-gamepad"></i> Game Management</li>
<li style="padding: 5px 0px 5px 0px;"><b>Schedule Options</b></li>
<li><i class="fa fa-paint-brush"></i> Customize Schedule
<li><i class="fa fa-pencil"></i> Edit Pages</li>
<li style="padding: 5px 0px 5px 0px;"><b>Event Management</b></li>
<li><i class="fa fa-trophy"></i> Manage Events
<li><i class="fa fa-plus-circle"></i> Add New Event
<li style="padding: 5px 0px 5px 0px;"><b>Staff Management</b></li>
<li><i class="fa fa-users"></i> Staff Management</li>
<li><i class="fa fa-calendar"></i> Roster Management</li>
<li><i class="fa fa-link"></i> Sponsor Management</li>
<li style="padding: 5px 0px 5px 0px;"><b>Administration</b></li>
<li><i class="fa fa-users"></i> User Management</li>
<li><i class="fa fa-cogs"></i> Permission Groups</li>
<li><i class="fa fa-sitemap"></i> Page Permissions</li>
<li style="padding: 5px 0px 5px 0px;"><b>Staff Links</b></li>
<li><i class="fa fa-gamepad"></i> Your Sponsored Games</li>
<li><i class="fa fa-users"></i> Your Sponsored Hosts (Weekly)</li>
<li><i class="fa fa-users"></i> Your Sponsored Hosts (Event)</li>
<li><i class="fa fa-calendar"></i> Your Staff Roster</li>
<li style="padding-top: 10px;"><i class="fa fa-wrench"></i> Account Settings</li>
<li><i class="fa fa-sign-out"></i> Log Out [ admin ]</li>
</ol>
</div>
<!-- End links sidebox -->
</div>
<div class="content">
<div style="padding-bottom:10px;">
<form name="form1" method="get" action="">
<select name="Event" required style="width:257px; height:25px; font-size:18px; border:1px solid #000;">
<option value="">Change Event</option>
<option value='NewEvent'>NewEvent</option><option value='oneady'>oneady</option><option value='Test'>Test</option><option value='Testing'>Testing</option></select>
<input type="submit" name="submit" class="buttonRefresh" value=" "></div>
<div class="contentBoxHeader">
Your Sponsored Hosts for event
</div>
<div class="schedBox">
<table width="100%" border="0" cellpadding="2" cellspacing="0" align="center">
<tr>
<td width="50%" class="schedHeader">Host Name</td>
<td width="50%" class="schedHeader">Prize Sets Required</td>
</tr>
<tr>
<td class="schedHeader" style="border-top: 1px solid #000;">Total Prize Sets Required:</td>
<td class="schedHeader" style="border-top: 1px solid #000;"></td>
</tr>
</table>
</div>
</div>
</div>
<div class="footer">
<div class="footerTxt">
Schedule Interface Version 1.0 Beta.
</div>
</div>
Removing the position:absolute on the sidebar appears to resolve the issue.
Try using bootstrap. it responsive design and you can simply set your div width with it. download it here.

Bootstrap navbar appears differently in Firefox and Chrome due to browser rendering inconsistencies

The screenshot below is my bootstrap navbar which works nicely (pills disappear one by one as per spec). However when scaled down to various screen sizes, the navbar is no longer in-line and becomes staggered.
The issue is worse in Chrome than in Firefox because the left hand section of the navbar does not sit at the top of the screen.
If I can get Chrome to look like the Firefox screenshot, this will help me fix the remaining issues.
Can anyone suggest which browser rendering inconsistency would explain why on the Chrome version, the left hand portion of the navbar does not sit flush with the top of the screen?
Top is Chrome, bottom is FireFox.
<header>
<div class="vr-nav-container" data-ng-controller="navBarController">
<div>
<div class="col vr-nav-col1">
<div class="nowrap">
<nav class='navbar navbar-default navbar-static-top no-padding" role="navigation"'>
<a class='navbar-brand' href='/Default'>
<img height="30" class="logo" alt="Flatty" src="/Assets/images/logo-small-rocket-lg.png" />
<img height="30" id="xs-toggler" class="logo-xs" alt="Flatty" src="/Assets/images/logo_xs.png" />
</a>
</nav>
</div>
</div>
<div class="col vr-nav-col2 fill center">
<div class="nowrap">
<nav class='navbar navbar-default navbar-static-top " role="navigation"'>
<div class="tabbable ">
<ul class="nav nav-pills contrast-background">
<li data-ng-repeat="item in NavBarViewModel">
<a href="{{item.Path}}"><i class="{{item.Icon}}"></i>
{{item.Title}}
</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="col vr-nav-col3">
<div class="nowrap">
<nav class='navbar navbar-default navbar-static-top" role="navigation"'>
<ul class='nav'>
<li ng-controller="awardBoxController" class='dropdown medium only-icon widget'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>
<i class='icon-trophy'></i>
<div class='label'>{{AwardSummary.TotalPoints}}</div>
</a>
<ul class='dropdown-menu'>
<li>
<div class="box-content box-statistic">
<h3 class="title text-error">{{AwardSummary.Level}}</h3>
<small>{{AwardSummary.TotalPoints}} points</small>
<div class="text-banana icon-trophy align-right"></div>
</div>
</li>
<li><a href="/#/Awards/My-Points/">
<div class='points-history box-content widget-body'>
<div class='pull-left icon'>
<i class='icon- text-banana'></i>
</div>
<div class='pull-left text'>
<span><strong>Point History</strong> <span class="see-all">- see all</span></span>
<small class='text-muted'>{{award.AcheivedDate}}</small>
</div>
</div>
</a></li>
<li ng-repeat="award in AwardSummary.Awards">
<a href='#'>
<div class=' box-content widget-body'>
<div class='pull-left icon'>
<i class='icon-{{award.Icon}} text-success'></i>
</div>
<div class='pull-left text'>
{{award.Name}}
<span class="text-muted">+{{award.Points}}</span>
<small class='text-muted'>{{award.AcheviedDate| fromNow}}</small>
</div>
</div>
</a>
</li>
<li class='divider'></li>
<li class='widget-footer'>
<a href='/#/Awards/High-Scores/'>High Scores</a>
</li>
</ul>
</li>
<li class='dropdown medium user-menu'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>
<img width="23" height="23" src="/Assets/images/avatar.jpg" />
<span class='user-name'>
<asp:Literal ID="UserFirstNameLiteral" runat="server" meta:resourcekey="UserFirstNameLiteral">FirstName LastName</asp:Literal></span>
<b class='caret'></b>
</a>
<ul class='dropdown-menu'>
<li>
<a href='/UserAccount/UserProfile'>
<i class='icon-user'></i>
<%= this.GetGlobalResourceObject("MasterPage","Profile") %>
</a>
</li>
<li>
<a ng-if="ShowSettings" href='/Settings/Dashboard'>
<i class='icon-cog'></i>
<%= this.GetGlobalResourceObject("Resources","Settings") %>
</a>
</li>
<li>
<a ng-if="ShowSettings" href='http://todo.help.vr.zendeskurl.com'>
<i class='icon-bullhorn'></i>
<%= this.GetGlobalResourceObject("MasterPage","GetHelp") %>
</a>
</li>
<li class='divider'></li>
<li>
<form runat="server">
<asp:LinkButton ID="SignOutLinkButton" runat="server" OnClick="SignOutLinkButton_Click" meta:resourcekey="SignOutLinkButton">
<i class='icon-signout'></i> <%= this.GetGlobalResourceObject("Resources","SignOut") %>
</asp:LinkButton>
</form>
</li>
</ul>
</li>
</ul>
<div class='navbar-form navbar-right hidden-xs'>
<button class='btn btn-link dropdown-toggle' style="top: 4px;" name='button' data-toggle="dropdown" type='submit'><i class="icon-search"></i><span class="caret"></span></button>
<ul class="dropdown-menu">
<li>
<a category="" class="searchoption" href="#"><%= this.GetGlobalResourceObject("MasterPage","Everything") %></a>
</li>
<li class="divider"></li>
<li>
<a category="Deals" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Deals") %></a>
</li>
<li>
<a category="Contacts" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Contacts") %></a>
</li>
<li>
<a category="Accounts" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Accounts") %></a>
</li>
<li>
<a category="Tasks" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Tasks") %></a>
</li>
</ul>
<div class='form-group'>
<input value="" id="searchBox" class="form-control" placeholder='<%= this.GetGlobalResourceObject("Resources","Search") %>...' autocomplete="off" id="q_header" name="q" type="text" />
</div>
</div>
</nav>
</div>
</div>
</div>
</div>
</header>
CSS
I am using the default bootstrap 3.0 CSS and have a seperate CSS file overriding some default CSS and adding my own
I had to do this because the pills section has to be in its own div in the centre column in order to work (disappear one by one and 'stack' as width decreases) and fill all the width between the left and right cols in the navbar.
.navbar-collapse:after {
clear: none;
}
.sorting, .sorting_asc, .sorting_desc {
background : none;
}
.top-buffer {
margin-top: 20px !important;
}
.removeclass{
font-size: 1.5em;
vertical-align: middle !important;
}
.removeclass:hover{
text-decoration: none;
}
.vr-navigation {
float: left;
width: 100%;
}
.rightnav {
float: right;
width: 285px;
margin-left: -160px;
}
.leftnav {
margin-right: 160px;
padding:0 10px;
width:auto;
height: 40px;
}
.nav-pills {
height: 40px;
}
.hidden-xs {
display: inline-block !important;
}
#media (max-width: 767px) {
.hidden-xs {
display: none!important;
}
}
.current {
font-weight: bold;
}
.nav-pills li a {
color: white;
}
.vr-nav-container
{
display: table;
}
.vr-nav-container > div
{
display: table-row;
}
.vr-nav-container > div > div
{
display: table-cell;
}
.vr-nav-container > div > div
{
padding: 0em;
}
.vr-nav-container .nowrap
{
white-space: nowrap;
}
.vr-nav-container .fill
{
margin: 0 auto;
}
.vr-nav-container .center
{
text-align: center;
}
.vr-nav-col1
{
/*background: red;*/
width: 5%;
min-width: 50px;
white-space: nowrap;
}
.vr-nav-col2
{
width: 50%;
margin: 0 auto;
/*background: yellow;*/
}
.vr-nav-col3
{
/*background: green;*/
width: 40%;
/*min-width: 260px;*/
}
.no-padding
{
padding-left: 0px !important;
padding-right: 0px !important;
}
.main-nav-closed #main-nav .navigation > .nav > li:hover > a.toggler-flyout > span
{
display: none;
}
/*.main-nav-closed #main-nav .navigation > .nav > li:hover > a.toggler-flyout > i
{
content: "\f061";
}*/

Resources