November 26, 201213 yr 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 November 26, 201213 yr by Darth
November 26, 201213 yr 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