Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS - Display:block?

Featured Replies

Hi everyone,

 

I want to make my primary nav a little more user friendly, by having not just the text itself as a link. But the area around it too. What is the best way to do this?

 

Here's the link to the site - http://pt-academy.co.uk/

 

Cheers.

 

Rich

Here's the typical navigation code block I use when I design my websites.

    /***NAVIGATION***/

   .nav{
       width: auto;
       font: 14px "Comic Sans MS",Verdana,Arial,Tahoma;
       margin: 0 10px;
       height: 40px !important;
       overflow: hidden;
   }

   .nav ul{
       width: auto;
       margin: 0;
       text-align: left;
       height: 40px !important;
       overflow: hidden;
   }

   .nav ul li{
       display: inline;
   }

   .nav ul li a{
       color: #706150;
       padding: 10px 20px;
       margin: 0;
       text-decoration: none;
       text-shadow: #ffffff 1px 1px 1px;
       text-transform: lowercase;
       letter-spacing: .1em;
       line-height:40px;
   }

   .nav ul li a:hover{
       background: url('../images/hav-hover.png') repeat-x center center;  
       line-height:40px;      
   }

 

The .nav acts as the main container. The .nav ul allows me to align my navigational links (left, center, right). The main li tag is where I set my display time (inline is often best in my opinion), li a is where I define the padding and text style information. The line-height property is very important as it helps set the proper link block sizes. I started using this code a while back; I believe I whipped this up after watching several code styles over at DynamicDrive.com.

 

If you would like to see a demo, here is a new design in which I applied the above CSS: http://www.sazzadhossain.org/portfolio/7arts/

Edited by Sazzad

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.