Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6695981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:17:14+00:00 2026-05-26T06:17:14+00:00

I am working on a new blog site, it will document my code and

  • 0

I am working on a new blog site, it will document my code and such. I have a syntax highlighter which looks like the image below…


enter image description here


I have this CSS

.syntaxhighlighter {
  width: 100% !important;
  margin: 1em 0 1em 0 !important;
  position: relative !important;
  overflow: auto !important;
  overflow-y: hidden !important;
  font-size: .9em !important;
}

.syntaxhighlighter:hover {
  width: 135% !important;
}

As you can see in the image, the syntax highlited code is a certain width to fit in my layout, I am experimenting with making it wider when hovered for when the there is code that makes it wider then my content div.

That is where I added the .syntaxhighlighter:hover class and it works, when I hover the sytax highlighter div, it expands to the width I set. Now the only thing I am hoping to change if it’s even possible….

I would like to somehow only expand the highlighter div width IF the code inside it stretches beyond the normal width.

Can anyone help me with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:17:15+00:00Added an answer on May 26, 2026 at 6:17 am

    One thing you can try is to set min-width: 100%; and then set display:inline-block; This will mean that the width is determined by the content (having preformatted content means that it won’t wrap either), but it won’t shrink inappropriately because of the minimum width. You may find it desirable to set a max-width as well.

    Aside: be careful of over-using the !important directive – usually it isn’t necessary if you are specific with your selectors, and sometimes it messes up accessibility (e.g. if someone requires an overriding stylesheet to view webpages).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have put up a new blog which uses Toto with Rails 3 and
I am working on a new blog site, and I am far from seasoned
I've been working on a small blog form but have been having trouble with
I am trying to send notification emails(which is working fine) but have added the
I'm working on a new blog website created using ASP.NET MVC. I'm wondering what
I have an ASP.NET web site (blog based on blogengine.net). I want to perform
I have an MVC 3 site that is working and currently quite basic. There
I'm working on a small self made blog and I insert new blog items
I'm fairly new to working with Ruby on Rails. I've created a blog called
Am working on a site which allows users to participate in polls and earn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.