The non-responsive feature of PrettyPrint with Bootstrap makes it stand out from

Currently, I am utilizing Google's prettyprint alongside bootstrap to exhibit SQL statements with syntax highlighting. However, there seems to be a disconnect in terms of responsiveness, as it does not adhere to the column width of 12 in bootstrap. Instead, it maintains its own fixed width and height. Despite my attempts with the prettyprint class and bootstrap's grid system, I have been unsuccessful in altering this behavior.

  <div class="col-md-12">
    <h4>Query Output</h4>
    <code class="prettyprint">Select name, description From android_db.group Where id=&#39;1&#39;;</code>
  </div>

Answer №1

The explanation for this is straightforward; the code tag has a special style associated with it; which is logical when you think about the purpose of the code tag. My suggestion would be to utilize the pre tag instead - like this:

<pre class="prettyprint"></pre>

This will help avoid any issues. Also, remember to encode < and > as &lt; and &gt; respectively. Otherwise, they may not display correctly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the way to modify the standard request for an "@" in the email address?

Although I've successfully changed the error message for when the user forgets to type in their email, I'm now wondering how to modify it when the user enters their email in the wrong format. Below is the code I've written in the style of B ...

Seeking help on modfiying div content with AJAX - any tips for showing navigation using hash or anchor?

Looking to create a dynamic page that updates content within a div asynchronously while also providing users with direct access to specific content within the div by using anchors (e.g. www.website.co.uk/#page1). I've successfully implemented the upd ...

Add a JSON file containing an image path as a value into a CSS background property

I currently have a MongoDB database containing documents with 'img' values structured as follows: "img": "../folder/img.jpg" Would it be feasible to utilize this string in my CSS for modifying the background image? This is essential because I n ...

Say goodbye to my HTML5 creations

I am currently working on an HTML5 grid project that involves implementing a rectangle select tool for use within the grid. Everything is going smoothly, except for the fact that when I attempt to use the rectangular select tool, the grid disappears from t ...

JavaScript - Shuffle Cards Memory Game Function

I've been working on developing a memory game using JavaScript, and I've encountered some challenges along the way. After successfully designing the HTML and CSS components, my focus has now shifted to implementing the JavaScript functionality. O ...

What are the best methods for retrieving information from HTML pages?

My current setup involves using django-autocomplete which consists of two fields: one for tag-search with autocomplete functionality and the other for full-text search. However, while the full-text search is working properly, the tag search feature seems t ...

Steps for including a solid bottom border in a toggled navigation bar that is responsive

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document&l ...

What could be causing my CSS menu to occasionally display incorrectly?

I'm currently facing a challenge with the main menu on my website. Occasionally, about 1 out of every 10 times, the menu fails to load correctly. Please see the images below for comparison! This is how the menu is intended to appear: ...and this i ...

Is it possible to eliminate the input border within React-Bootstrap?

Struggling to remove the input borders of the Form.Control component in React-Bootstrap. Despite searching for answers, nothing has been able to solve this issue. I've attempted redefining the .css classes "input" and "form-control", trying to set th ...

Switching the display of a Bootstrap navigation dropdown

After building a Bootstrap menu with a lightbox effect that overlays the page content when expanded, I encountered some issues. I attempted to use JavaScript functions to hide and display the lightbox_container element when toggling the nav. However, addi ...

Implement a top bar above the navigation bar using Bootstrap

Attempting to construct a webpage from scratch for the first time, without relying on a template. I aim to implement a fixed top bar above the navigation bar. Referencing this example: This is my current code: window.onscroll = function() { scrollFun ...

How do I navigate to a different page in Vue.js HTML based on user selection?

Here is my first attempt at writing HTML code: <div class="col-md-4" > <div class="form-group label-floating"> <label class="control-label">Select No</label> <select class="form-control" v-model="or" required=""> ...

I'm encountering difficulties trying to align my images in the center on a mobile device using foundation's XY grid system

I recently created a practice website using the new Foundation xy grid. However, I noticed that when I resize the browser to a smaller screen size, the images are no longer centered and instead hug the left side of the page. It's only when I make the ...

Creating a custom HTML pattern input for restricting input to only specific numbers

I need to set a specific requirement for the zip code section of my form. Only 5 numbers are allowed, and it must start with either 46,52,53,54,60,61,62 as specified in an html pattern. ...

Choose the tr element using JQuery when none of the images in the td contain the file name example.png

Is there a way to select the tr elements that do not contain example.png in any of their td elements? Each image has an anchor, so I was thinking of selecting based on that... $(document).ready(function(){ $("td > a").parent(). ...

Applying JavaScript to HTML - Implementing a function to only display an input statement when the "Yes" option is selected, otherwise keeping it hidden

I am currently delving into the world of JavaScript, aiming to comprehend its intricacies. With limited experience in this language, I have managed to successfully hide and unhide radio buttons based on user input. My next challenge lies in achieving a si ...

Issue with displaying images in Bootstrap carousel

I'm facing a challenge with integrating a bootstrap carousel into a website project I'm customizing for a client. Despite my efforts to add photos and captions, the images are aligning in a list format and the captions are stacking on top of each ...

Trigger the execution of the second function upon the successful completion of the first

In the following code, my concept is to display: The clicked kingdom (clicked_id) initiates an attack on (clicked_id). https://i.stack.imgur.com/Bx8QW.png https://i.stack.imgur.com/Cg2GL.png https://i.stack.imgur.com/gUNxM.png How can I trigger the sec ...

Division of two "div" sections

I have designed my webpage using three separate div elements for [logo, brand name], [product details], and [hamburger icon]. However, when applying display=flex and flex=1 in the CSS, I noticed that the last two elements are getting stuck together. Can so ...

Utilizing jQuery for a click event to create a random quote generator using a JSON API

Seeking guidance on my first attempt at using the JSON API for a challenge from freeCodeCamp. The task is to create a random quote machine. Upon clicking the "New Quote" button, the goal is to display a new random quote retrieved via jQuery looping throug ...