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.

Floatingelement lineheightproblem

Featured Replies

Hello together,

 

I have no idea what the heck goes wrong.

 

I put a "read more" button inside a text. Wishing to float right so thats at the end of the text but also inside it.

 

After I puting the floating element inside it, i see a problem with the last line.

The height seems to be 2-4px heigher than the rest.

 

Maybe someone here can solve it.

 

CSS:

.mehr {
float:right;
font-family: 'Homenaje', sans-serif; /* google @fontface */
font-size: 16px;
padding:5px;
font-weight:400; 
background:#000000; 
color:#FFFFFF;
display:inline; /* text an bg anpassung */

}

 

html:


<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est  dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diamdolore magna aliquyam et dolore magna aliquyame sed diam nonumy eirmod tempor<div class="mehr">mehr lesen</div> labore et dolore magna aliquyam</p>


post-31441-0-07618400-1333285788_thumb.png

Edited by .dark .negativ .antisocial

The problem isn't with the code in your post. Look at the parent elements. Did you set a line-height? Is it in pixels or ems?

  • Author

The problem isn't with the code in your post. Look at the parent elements. Did you set a line-height? Is it in pixels or ems?

 

Thanks for your thoughts.

The problem was with the paragraph <p> and you´re right.

Set-up of lineheight in <p> and the floating div didn´t match.

 

Seriously I went crazy and then it was just that silly <p> :-D

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.