What steps can I take to enhance the responsiveness and overall performance of this code using bootstrap?

Struggling with making your website responsive? No worries, we've all been there. Whether you're a pro at coding in react.js and vue.js or a complete beginner, we all need to start somewhere. Any suggestions or tips on how to improve responsiveness would be greatly appreciated.

Right now, the website looks terrible when the screen size is reduced. Let's work on fixing that!

Html/bootstrap

<section id="info" class="py-3">
    <div class="container text-white">
      <div class="row justify-content-center">
        <h2 class="text-white title">Lorem ipsum dolor sit</h1>
        <p class="text-white cyp-para">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>
      </div>
      <div class="row">
        <div class="col-6 align-self-center">
          <div class="placeholder mx-auto"></div>
          <h1 class="text-center exp"> Lorem ipsum dolor</h1>
        </div>
        <div class="col-6 justify-content-center">
          <div class="placeholder mx-auto"></div>

          <h1 class="text-center exp">Lorem ipsum dolor</h1>
        </div>

      </div>
    </div>
  </section>

CSS:

#info{
  height: 515px;
  width: 732px;
  background: #151515 0% 0% no-repeat padding-box;

}

.cyp-para{
  padding: 0px 200px;
  font-size: 14px;
}

.placeholder{
  width: 236px;
  height: 283px;
  background: grey;
}

.title{
  font-size: 38px;
}

.exp{
  font-size: 33px;
}

Answer №1

To enhance the responsiveness of your code with bootstrap, you can utilize break-point classes.

Implement slight modifications as shown below to improve the appearance of your code:

<section id="info" class="py-3 ">
    <div class="container text-white">
      <div class="row justify-content-center">
        <h2 class="text-white title">Lorem ipsum dolor sit</h1>
        <p class="text-white cyp-para">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>
      </div>
      <div class="row">
        <div class="col-12 col-md-6 align-self-center">
          <div class="placeholder mx-auto"></div>
          <h1 class="text-center exp"> Lorem ipsum dolor</h1>
        </div>
        <div class="col-12 col-md-6 justify-content-center">
          <div class="placeholder mx-auto"></div>

          <h1 class="text-center exp">Lorem ipsum dolor</h1>
        </div>

      </div>
    </div>
  </section>

I have integrated col-12 and col-md-6 classes into your code. This indicates that up to medium-sized devices, you will have divs spanning 12 columns, which equates to one full column width. As the screen size transitions to medium and larger devices, you will have two columns per row.

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

Excessive content causing an overflow within the table and extending the length of

My page is currently overflowing its length compared to the main table, and I want it to be as long as the table. The issue seems to be related to the code snippet below: thumbnail { padding: 0; background-color: transparent; transition: transfo ...

The issue with the CSS combination of :after and :hover:after across different HTML elements

Encountering an issue while attempting to create a rollover effect using CSS :after and :hover pseudo-elements. Check out the clock and facebook icons on the right side by visiting: See below for the CSS code: .icon { background: url('. ...

Using Python in Selenium to set the value of a dropdown menu within an <input> element

I am working with an HTML page that has a form containing a dropdown tag. My goal is to set the value of this dropdown tag using Selenium. When I retrieve the input element, here is the code snippet: driver.find_element_by_xpath("/html/body/div[2]/div/di ...

The console is not displaying the data from the useForm

I am working on a project to create a Gmail clone. I have implemented the useForm library for data validation. However, when I input data into the form and try to print it to the console, nothing is being displayed. const onSubmit = (data) => { ...

Tips for preventing text from breaking onto a new line in Safari

I have cforms plugin installed on a WordPress page. Interestingly, the word "required" in Russian appears to consist of two words as per the translation office. While it displays correctly in Firefox, in Safari it breaks and aligns to the bottom left of ...

"Discover the versatility of implementing a single ag grid across various components, all while dynamically adjusting its style

I am facing an issue where I have an angular grid ag-grid in component1, which is being used in some other component2. Now, I need to use the same component1 in component3 but with a different class for ag-grid, specifically 'ag-grid-theme-dark'. ...

Why Isn't This JPG Image Functioning Properly in HTML/CSS?

I am facing an issue with a JPG image that I am attempting to use in CSS as a background-image for a div container. For some reason, this particular image refuses to render in the viewport. Interestingly, when I inspect the element, I can see its thumbnail ...

When using flexgrid, be aware that adjacent divs on the same row may shift position when applying floats

Struggling with aligning the divs in a row when floating one of them? Here's a snippet to illustrate the issue: .flex-grid { display: flex; justify-content:space-between; } .flex-grid .rcorners1 { border-radius: 25px; background: green; ...

How can I adjust the gravity or positioning of a tipsy tooltip in jQuery?

Is there a way to adjust the position or gravity of Tipsy? The plugin offers various options for gravity that can be set through the script: nw | n | ne | w | e | sw | s | se Currently, I have set it to s position, as shown in this demo: http://jsfiddle. ...

Utilizing JavaScript to display numerous variables within a text box

After creating an HTML form, I encountered an issue where only one selected item was displayed in the text field. Can anyone help me solve this problem so that multiple names can be printed in the textfield? function myFun(extras) { document.get ...

Some characters are not compatible with the CSS writing-mode feature

There seems to be an issue with the CSS writing mode not applying correctly to the symbol '№'. Here is an example: <html> <head></head> <body> <p style="writing-mode: vertical-lr;"> Номер № ...

The Ajax request is successful on one server but fails on another

I have implemented an ajax call to the UPS address validation webservice. The call is successful when made from my application using this domain: http://serverone.org/addrvalidator. However, if I try using a different domain or an IP address instead of th ...

Child element casting shadow over parent element

I am currently using box shadow for both the parent (.map) and child (.toggle-button): .map { position: fixed; top: 20px; right: 0; width: 280px; height: 280px; z-index: 9999; box-shadow: 0px 1px 6px 0px rgba(0,0,0,0.3); } .map ...

What could be causing the extra space at the top of my div element?

My goal is to accomplish the following: However, there appears to be an unnecessary gap above the Social icons div. You can view the live page at This is my current markup:- <header> <img src="images/home-layout_02.jpg" alt="Salem Al Hajri Logo ...

Please send the element that is specifically activated by the onClick function

This is the HTML code I am working with: <li class="custom-bottom-list"> <a onClick="upvote(this)"><i class="fa fa-thumbs-o-up"></i><span>upvote</span></a> </li> Here is my JavaScript function for Upvot ...

CSS: "Cutting-edge" design. In what way?

I am seeking to replicate a design similar to that of Fantastical's website (https://flexibits.com/fantastical), where the edge of a screenshot extends beyond the page boundary. As the user resizes the window, more of the screenshot becomes visible. A ...

Divs expanding below content in IE on a particular server

Currently, I am facing an issue with a JavaScript div that expands correctly over other content in most situations but goes under the content in one specific scenario. I am unsure about where to begin debugging this problem. To provide some context, the d ...

Utilizing Python's Requests Library to Submit a Form without Specifying Input Names

My task is to perform a POST request using the Python Request module. However, I am facing an issue where the input I need to work with only has an id attribute and no name attribute. Most of the examples I have come across involve using the name attribute ...

What happens when a PHP field is left empty?

I have created 3 PHP files. The first file contains fields to be filled out, similar to an HTML form. The second file takes the data from the first file and saves it in a text file with the title as the date and time. The third file confirms the registrati ...

What steps should I take to resolve the navigation bar problem on my website?

How can I resolve the navbar alignment issue on my website? Upon visiting this link (), you will notice that the navbar buttons appear cramped together on the homepage. However, the same code implemented on the "About us" and "Contact us" pages does not ex ...