The paragraph tag remained visible despite the use of the hidden display property

Can you help me figure out why my code isn't working with .d-none .d-sm-block?

   <div class="container">
      <div class="row row-content align-items-center">
        <div class="col-12 col-sm-12">
          <h2>heading 1</h2>
          <p class=".d-none .d-sm-block">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
          </p>
          <h3>heading 2</h3>
          <p class=".d-none .d-sm-block">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
          </p>
          <h3>heading 3</h3>
          <p class=".d-none .d-sm-block">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
          </p>
          <h3>heading 4</h3>
          <p class=".d-none .d-sm-block">
           Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
          </p>
        </div>
      </div>
    </div>

I'm trying to only hide those paragraphs on xs screen sizes, following the Bootstrap official documentation. You can find my codepen here. Any assistance would be appreciated.

Answer №1

The correct way to define class names is without using dots. Example: class=".d-none .d-sm-block"

Instead, it should be: class="d-none d-sm-block"

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

Stop unauthorized pages from hijacking login cookies

I have a website called where users can create their own HTML pages accessible through the link if the username is "USR" and project is "PROJECT". However, there is a security concern... Currently, I store users' login tokens as cookies. But what ...

conceal the android keyboard when focusing

Encountering an issue with my web application. Seeking a method to conceal the android keyboard when a text input is focused without disrupting the input focus. The focus on page load is working well as the field is focused and the keyboard is not displ ...

Prevent css from reverting to its original rotation position

I attempted to style the navigation list with the following CSS: #navlist:hover #left-arrow { border-top: 10px solid white; position: relative; transform: translateX(120.2px) rotate(180deg); } Would it be better to use jQuery for the rotation ...

What is the best way to align an error message in the middle of an HTML table?

I have a block of HTML code that generates a table displaying all the posts. If there are no posts to display, I want to show an error saying No posts found. My current focus is on centering this error message within the table. To achieve this, I have a ...

Designing a responsive two-column table layout

My current challenge involves a small table structured as a bullet list with two columns. To enhance mobile display, I am seeking a way to collapse it down to a single column: https://i.sstatic.net/LqbA6.png The current implementation includes the follow ...

What steps can I take to prevent my menu items from overlapping in the mobile navigation menu?

I am currently working on creating a mobile menu, but I'm facing an issue where the menu items overlap when hovered over. Instead, I want the menu items to move downwards when hovered upon to prevent the text from overlapping. Below is the HTML code ...

Cross-domain scripting with JavaScript

I currently manage 2 subdomains securityservices.example.com workstations.example.com All workstations are associated with the workstations.example.com One of the workstations, known as WS789012 on the domain, is fully qualified as: WS789012.workst ...

What is the best way to align content at the center on mobile using Bootstrap 5?

I'm struggling to center elements on mobile devices, even though they look fine on desktop. Desktop: https://i.sstatic.net/I6Rtf.png Mobile: https://i.sstatic.net/4a1zS.png Desired mobile: https://i.sstatic.net/uMrEa.png I am using Bootstrap 5.3 ...

Bootstrap 4.5 integration in jQuery builder is malfunctioning

Take a look at this jsfiddle that attempts to utilize jQuery QueryBuilder with Bootstrap 4.5 References Bootstrap CSS jQuery Library Bootstrap JavaScript jQuery QueryBuilder Plugin Here is the HTML code snippet for the builder section: <div id=" ...

Border utilities in Bootstrap 4 provide easy ways to add borders

I have been searching for a solution, but I can't seem to find it. Bootstrap 4 offers utility classes for adding and removing borders, but is there a way to define the border width or style like solid or dashed? <span class="border"></span&g ...

Implement various actions when the window is resized

The carousel code I have found returns a different number of items to display based on screen size. You can check it out here. $(function() { var mini = 1000; var big = 1280; if (window.screen.availWidth < mini) { $('#carousel1').jsCar ...

How can I ensure my HTML/CSS webpage resizes automatically to fit all screen sizes?

I created a login screen for my website class term project which is due soon. It looks great, but I noticed that when I resize the browser, the entire page falls apart. Everything starts overlapping each other, which is quite comical. I've tried usin ...

Substituting a JavaScript function with a UserStyle solution

I am currently working on customizing a UserStyle for Instapaper. Since the original UserStyle was created, Instapaper has implemented several JavaScript functions in their header that control page width and font styles. Below are the functions: ...

Selecting properties from a GeoJSON object on the fly with Leaflet

I am currently attempting to dynamically modify the displayed property on my leaflet map. Below is the code I have been working with: $("#button_thermal").click(function(){ $.getJSON("physicalProperties.geojson", function(data) { var geojson2 = L.geoJson( ...

A Webpage that is permanently open, with no option to close it. The only option is to watch the video in

Currently, I am designing web pages for artists to showcase their work in an upcoming exhibition. The pages are ready, but now the artists are requesting that each piece be accompanied by a laptop displaying a single webpage with a video providing informat ...

NextJs does not have Bootstrap loaded

I am currently working on a NextJs application where I have integrated bootstrap. Package.json: "dependencies": { "@zeit/next-css": "^1.0.1", "@zeit/next-sass": "^1.0.1", "autoprefixer&q ...

When JQuery inserts HTML code, the alignment may differ compared to when the HTML code is written

Important: Check out the comments made by Brandson below, as it contains the correct response. I have created a basic form that allows users to enter various languages (such as english, french, spanish, etc) and their respective proficiency levels (simila ...

Having trouble sending the information to Parse.com using the website

I am a beginner with the Parse database and I am currently working on implementing a code that allows users to sign up, with their information stored in the Parse database. However, I am encountering an issue where the values are not uploading as expected. ...

Discrepancies in Video Element Size: Mobile Versus Desktop

Why does the video element have different sizing behavior between mobile and desktop? I noticed on this website that on desktop Chrome, its width is about 35% of the browser while on iPad Chrome it's only about 10% Does anyone know why this is happen ...

Concealing Contact Form Using Javascript

Upon making adjustments to a website, I encountered an issue with the contact form. The form is meant to be hidden on page load and only appear when the envelope icon is clicked. However, currently the form is visible by default, and clicking the envelope ...