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.

Highlight only the text within the p tags

Featured Replies

Hi

 

This seems a simple thing to achieve but is something I'm still failing to. What I want to do is to allow only the text on a page to be highlighted on a page without extending to the margin on either side. On the website I'm currently working on, when I highlight a line of text enclosed in the p tags the entire width of the window gets highlighted from side to side. Could someone please advise me how you can let highlighting take effect just on the text? I know the P tags create a block.

 

Thank you,

 

Darth

Edited by Darth

That's the thing, <p> elements are block level so they are automatically 100% wide. Try either setting those <p>'s to inline or inline-block or try using an inline element such as <span>

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.