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 - Bottom border width

Featured Replies

Hi there

 

I am using the bottom border as a underline, I have tried the text underline bit want to be able to make adjustment.

 

The issue I have is that the border stretches the width of the page and I want it to automatically adjust to each title.

 

The site is locally hosted so cant give address, also it is a wordpress site.

 

Html

<div id="title"><div id="underline_title"> Title </div></div>

 

CSS

 

 

#underline_title { 
 width:autopx;
 margin-left:auto;
 margin-right:auto;
 border-bottom-color:#949494;
 border-bottom-style:solid;
 border-bottom-width:1px;}

#title {
 color:#202020;
 width:autopx;
 font-family:'Droid Serif', sans-serif;
 font-size:25px;
 text-align: center;
 line-height:1.5em;
 margin-left:autopx;
 margin-right:autopx;
 margin-bottom:5px;}

 

Any help would be great, have not been using css for long so it may be something very simple that I am doing wrong.

 

Regards

 

Tom

Edited by tommy999

Either

#underline_title {

width:autopx;

margin-left:auto;

margin-right:auto;

border-bottom-color:#949494;

border-bottom-style:solid;

border-bottom-width:1px;

display: inline;}

 

or

 

<div id="title"><span id="underline_title"> Title </span></div>

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.