Have I incorrectly implemented responsiveness on my website?

I created my HTML using Bootstrap 3.3.7:

<html>
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <meta name="copyright" content=""/>
            <meta name="author" contect="Toki, 2016/12/30"/>
            <title>toki</title>
            <link rel="shortcut icon" type="image/ico" href="favicon.ico"/>
            <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
            <link href="assets/css/bootstrap-theme.min.css"" rel="stylesheet" type="text/css"/>
            <link href="assets/css/toki.css" rel="stylesheet" type="text/css"/>

        </head>
        <body>
            <div class='container'>
                <div class='row'>
                    <img class='bg' src='assets/media/main-bg.jpg'/>
                    <div class='row'>
                        <img class='logo' src='assets/media/logo.png'/>
                    </div>
                    <div class='row'>
                        <div class='row'>
                            <div class='main-content'>
                                <div class='downloadbox'>
                                    <div class='downloadbtn'>
                                        <a href="#" class='iosdownload'></a>
                                        <a href="#" class='androiddownload'></a>
                                    </div>
                                    <a href='#' class='call-btn'></a>
                                </div>
                            </div>
                        </div>
                        <div class='row'>
                            <div class='main-icon'>
                                <div id="myCarousel" class="carousel slide" data-ride="carousel">

                                    <ul class="nav nav-pills nav-justified">
                                        <li data-target="#myCarousel" data-slide-to="0" class="active"><a href="#">Thông Tin game</a></li>
                                        <li data-target="#myCarousel" data-slide-to="1"><a href="#">Tính Năng</a></li>
                                        <li data-target="#myCarousel" data-slide-to="2"><a href="#">Nổi Bật</a></li>
                                    </ul>
                                    <div class="carousel-inner">
                                        <div class="item active">
                                            <img src="assets/media/ts1.jpg"/>
                                        </div>
                                        <div class="item">
                                            <img src="assets/media/ts2.jpg">          
                                        </div>
                                        <div class="item">
                                            <img src="assets/media/ts3.jpg">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <script src="assets/js/jquery-1.12.4.min.js"></script>
            <script src="assets/js/bootstrap.min.js"></script>
            <script src="assets/js/toki.js"></script>
        </body>
    </html>

And here is my CSS:

.bg{ 
        min-height: 100%;
        min-width: 1024px;
        /* Set up proportionate scaling */
        width: 100%;
        height: auto;
        /* Set up positioning */
        position: fixed;
        top: 0;
        left: 0;
        z-index:-999999;
    }

    .logo{  
        z-index:1;
    }

    /* More CSS styles go here... */

I believe that my website is responsive, but my friend disagrees. Do you think I did something wrong?

Answer №1

A common mistake when using Bootstrap is not following the proper structure for rows and columns.

It's important to place rows inside a .container or .container-fluid to ensure correct alignment and padding.

Rows are used to create horizontal groups of columns, so make sure content is placed within columns.

Remember that only columns should be immediate children of rows, so avoid nesting rows inside rows. Use 'col-md-12' as a child of row for the desired layout.

Columns create gaps between content with padding, which is adjusted within rows for the first and last column using negative margins on .rows.

Refer to the Bootstrap documentation for more information on the Grid system: http://getbootstrap.com/css/#grid-intro

Answer №2

Utilizing a 12-column grid system is one of the key features of Bootstrap. This grid divides the entire viewport into 12 columns, providing flexibility in designing layouts for different screen sizes. Bootstrap offers four primary screen sizes - xs, sm, md, and lg, each with its own pixel ranges. To leverage this grid system effectively, developers can apply the pre-defined class 'col' by specifying the target screen size along with the number of columns required. For instance, using .col-xs-12.col-sm-3.col-md-5.col-lg-7 means that a div will occupy 12 columns on xs screens, 3 on sm screens, 5 on md screens, and 7 on lg screens respectively. If a specific size is not specified, Bootstrap adapts based on the previous declaration. This versatile approach allows for complex layouts tailored to various devices.

To delve deeper into mastering this grid layout concept, refer to: http://www.w3schools.com/bootstrap/ For comprehensive documentation, visit: http://getbootstrap.com/getting-started/

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

Problem involving non-breaking spaces

After changing the font-family of my website from Gotham Pro to Gotham, I encountered an issue with the styling of numbers that were formatted using my currency formatter function. Strangely, when the &nbsp character is removed, everything appears to b ...

Room available on the body's right side for tiny gadgets

I'm currently facing a website issue while using Bootstrap. Everything seems to be working fine until I attempt to check the responsiveness of my website. There appears to be an excessive white space on the right side of my body, but only in a specifi ...

AmazingStew 4 - How to substitute anchor element with its text

My document contains HTML content and I am looking to replace all anchor tags with their respective texts using BeautifulSoup. Here is the input: html = '''They are also much more fuel-efficient than <a href="http://someurl.com">rock ...

Utilize an npm package to transform a CSS file into inline styles within an HTML document

I have an HTML file with an external CSS file and I would like to inline the styles from the external style sheet into one inline <style> tag at the top of the head. Any assistance would be greatly appreciated. Note: I do not want to use the style a ...

Ensure the footer remains at the bottom of the page even with changing

I am encountering an issue with positioning a footer under dynamic content displayed in a div named txtresults. The div is updated with HTML following a query made with an input value, as shown in this example on JsFiddle: JsFiddle Currently, I am struggl ...

Proper alignment of div elements using Bootstrap

I am attempting to align 2 div elements side by side using Bootstrap code: <div class='col-12'> <div class='row'> <div class='col-6'> </div> <div class='col-6&a ...

Issue with MaterializeCSS: Unable to add new options to select menu

I have a function that appends options to a dropdown based on the onchange event. The options are being appended successfully, but they are not visible when clicking the dropdown. $(document).ready(function(){ $('select').formSelect(); }) ...

What is the best way to ensure the logo is centered when the screen size reaches 750?

Looking to center the logo on a media screen size breakpoint? View the photo (Here): https://i.stack.imgur.com/UnB2F.png Check out my code below: .logo img { padding: 15px; width: 125px; } <nav> <ul class='nav-bar'> < ...

What are some methods for applying border styles to the first and last row of a table using Material UI?

In my current project, I am utilizing the combination of Material UI and React Table. Recently, I was asked to implement an expandable row feature, which I successfully added. Once the user expands the row, we need to display additional table rows based on ...

When dynamically adding input fields in Bootstrap, there is a smaller gap between inline inputs

When adding a new list item dynamically in a modal using jQuery append, the spacing in the first li element seems to have a larger gap between the input fields compared to the rest that are added later. Even after checking the developer tools and confirmin ...

Using Javascript, dynamically animate the text in the hero unit with fading in and out effects

I currently have a "Hero" unit with the following code: <div class="hero-unit"> <div class="container"> <h1>Dapibus Euismod Mollis</h1> <p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis ...

Creating a secure webpage that can only be accessed with a password

Is there a way to create a username/password login page using only client-side technologies without involving the server? Back in school, I was taught to use SQL and Java on the server side for this purpose. However, I'm now faced with a situation whe ...

What is the best way to reveal or conceal a div element on mouseover with jQuery?

Currently, I have a table with the following structure. <table> <tr> <td id="divOne">div one</td> <td id="divOne">2222</td> </tr> <tr> <td id="divOne">d ...

Troubleshooting issues with Bootstrap Nav-pills functionality

I have encountered an issue with my navigation structure. I am using a main nav-menu and a secondary nav-menu within the same div. When I first enter the page, the "Profile" tab is correctly active by default. Then, when I click on "Test", it becomes activ ...

When the page is resized for mobile, the Bootstrap modal shifts downwards

I am encountering an issue with a modal that pops up on my webpage when clicked. It is perfectly centered in a browser view and smaller views. However, when I resize the page for phones, the modal shifts down the page and requires scrolling to see it. How ...

I am having issues with Tailwind CSS overriding the responsive padding on my website

I'm currently working on implementing responsive padding for a component. Given that Tailwind CSS follows a mobile-first approach, I have set the mobile padding to p-3, while screens at "md" and larger widths should use p-5. However, it seems like the ...

When I update URLs in Django, my CSS breaks down

Recently, I encountered an issue on my website and found a solution by creating two separate HTML pages. However, when I modified the urls.py to differentiate the URLs for these pages, the CSS stopped working. Below is my code snippet and a detailed explan ...

Angular material table cell coloring

Here is my current setup: I have an array of objects like this: users : User []; average = 5; compareValue (value){ ...} And I am displaying a table as shown below: <table mat-table [dataSource]="users"> <ng-container matColumnDef= ...

What is the best way to relocate a child component to a different parent in React?

I have a list of child components with checkboxes, and when a checkbox is clicked, I want to move that child component inside another div. Below is an illustration of how my app should look. I need to select student names and shift them up under the "Pres ...

How to toggle between checked and unchecked states using jQuery within AngularJS?

After reloading, the checkbox should maintain its checked or unchecked state. This functionality can be achieved using a directive controller. var checkboxValues = JSON.parse(localStorage.getItem('checkboxValues')) || {}, $checkboxes = $("#c ...