CSS properties for SVG image borders not displaying correctly

I'm having trouble creating a border around a round SVG image with the class "lock feature". When I try to add the border in the CSS element ".lock feature", the text "feature" stays white and the border doesn't show up in the browser. However, if I change the selector/element from ".lock feature" to "img" and then apply the border properties, the border appears. Can anyone provide assistance?

<style>
    html,body{
      font-family: 'Open Sans',sans-serif;
      text-align: center;
    }

    *{
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      
    }

    #page-wrapper {
      position: relative;
    }

    #header {
    position: fixed;
    top: 0;
    left: 0;
    height: 90px;
    background-color: rgba(0, 0,0,.5);
    width: 100%;
    }

       .logo {
    float: left;
    }

  #header-img {
    height:100%;
  }

    nav {
     position: relative;
     float: right;
     height: 10vh;
     margin: 35px 0px;
     height: 20px;
     margin-right: 25px;
      }
      @media(max-width:453px){
  #nav-bar {
    position: absolute;
    width: 100%;
    top: 100%;
    margin:0;
  }

  #nav-bar li {
    display:block;
    background-color: rgba(0,0,0,.5);
    padding: 5px;
   }

    }
    
    li {
      display: inline-block;
      list-style: none;
     }

    a {
      text-decoration: none;
      margin: 20px;
      color: white;
      }

      .container {
        width: 100%;
        margin-top: 200px;
      }

      .grid {
        display: flex;
        margin: 0 auto;
        width: 80%;
        margin-top: 40px;
        margin-bottom: 40px; 
        }

      .description {
        text-align: left;
        margin: auto 18px;
        width: 70vw;
       }

       h2 {
         margin-bottom: 11px;
       }

       .lock feature {
         border-style: 3px solid black;
  
       }

       



     
</style>
<!DOCTYPE type>
<html>
  <head>
    <meta charset="utf-8"> 
  </head>
  <body>
    <div id="page-wrapper">
     <header id="header">
      <div class="logo">
       <img id="header-img" src="http://image.discountsoff.com/dryKPIu3fpLUjodbv1n2Q2EWdkA=/logos/aersf.com.png">
        </div>

          <nav id="nav-bar">
            <ul>
              <li><a class="nav-link" href="#features">Features</a></li>
              <li><a class="nav-link" href="#products">Products</a></li>
              <li><a class="nav-link" href="#about us">About Us</a></li>
            </ul>
          </nav>
     </header>
        
        
        
        <div class="container">
          <section id="features">
            <div class="grid">
              <img class="lock feature" src="https://svgur.com/i/9VC.svg" alt ="features">
              <div class="description"><h2>Lock Feature</h2><p>Aer started in 2014 as a crowdfunding project that combined a gym bag and an office bag into one simplified design. That project has grown into a mission to simplify the way you carry so you can worry less about what's on your back and focus more on what's ahead. Whether you're traveling between the office and the gym, or from San Francisco to Tokyo, there's a bag in our collection that's perfectly suited for your journey.</p>
              </div>
            </div>    
         
            <div class="grid">
              <img class="zip feature" src="https://svgur.com/i/9Vu.svg" alt="full bag">
              <div class="description"><h2>Zip Feature</h2><p>The Active Collection is a line of modern gym/work bags designed for the city professional. Go from the office to the gym and everywhere in between.</p>
              </div>
            </div> 
        
            <div class="grid">
                <img class="lap top feature" src="https://svgur.com/i/9UJ.svg" alt="about us">
                <div class="description"><h2>Lap Top Feature</h2><p>Inspired by the city, we create minimalist bags that balance smart features with a clean, architectural style.</p>
                </div>
            </div>
          </section>      
        </div>

            
        
        
        
        
        <div class="container">
          <section id="products"></section>
          <iframe width="560" height="315" src="https://www.youtube.com/embed/qeFOYlHmyGE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
        </div>
        
        
        <div class="container">
          <section id="about us"></section>
        </div>
        
    </div>    
  </body>
</html>

Answer №1

Here is a cool style to experiment with:

<style>
    .unlock.design {
             border: 2px dashed red;
             background-color: lightblue;
             padding: 10px;
           }
</style>

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

JQuery class for swapping elements upon scrolling

I am currently working on a navigation bar that changes classes to create a fading effect for the background. The approach I have taken involves targeting the window itself and monitoring the scroll position of the user. If the user scrolls down more than ...

Why isn't the document.getElementById().value() function functioning properly within my PHP code?

When working on my PHP code, I included the following: <select class="ht__select" onchange="sorting('<?php echo $id ?>')" id="sorting"> <option value="">Default sorting</option> <option value="low_price">Sor ...

Preventing default events on a jQuery slider: enhance user experience

I'm currently experimenting with the superslides library for my project, and I have been trying to implement custom effects on the animations. This is how I attempted to do it: During the beforeChange event, I want to prevent the event from propa ...

What could be the reason for the unexpected behavior of position sticky?

I am encountering an issue while trying to figure out why the container__item--special element behaves as a sticky element in this code snippet <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8> ...

Exploring the power of nested styled components in Material UI is a great way to elevate the styling of your project

Can someone explain how to access a second styled component using '@mui/system' in order to add a hover effect to a parent element that will modify the max-height of its child? Please keep in mind that I am referring to mui's styled compone ...

Building HTML tables with JQuery for handling large datasets of over 4,000 rows and beyond

My goal is to create a table with 4000+ rows and 18 columns displaying parsed pages from my site. I need it all on one page for the following reasons: I require the use of filters in the table I need to be able to sort by more than 5 columns Every cell ...

Get access to a PDF file by simply clicking a button that has a href link without any URL or file

After successfully simulating a click on the "PDF" link on a webpage, I am trying to save the downloaded PDF file to a specific location. However, I am facing difficulty in retrieving the URL for the PDF using the urllib library. Here is an example of the ...

What is the best way to generate an accordion populated with data from a MySQL query?

Everything is in order, I've got all the chapters and video series extracted without any issues: $id_course = 1; $stmt = $con->prepare("SELECT c.chapter, v.preview, v.title_video, ...

Uploaded images from mobile devices appear to be rotated when viewed on desktop browsers like Chrome and Firefox

I'm facing a strange issue where an image uploaded from a mobile device to my website appears rotated on Chrome and Firefox when viewed on a desktop. However, it displays correctly on mobile browsers like Chrome Mobile and Safari Mobile. It seems tha ...

Is there a way to display the next/previous buttons separately from the scroller in my jQuery thumbnail scroller implementation?

Is there a method to display the next and previous buttons outside of the scroller frame when using jQuery thumbnail scroller by manos.malihu.gr? I have attempted to modify the button class in CSS to make them more prominent or visible, but unfortunately ...

Using `encodeURIComponent` to encode a URL does not function properly when used with a form action

After experimenting with the encodeURI function in conjunction with a form, I discovered an interesting behavior. I used encodeURI to encode a URL. <html> <head> </head> <body> <form id="form"> </form> <button id="bu ...

Looping through PHP to set the background color of a map

A basic code I have writes out a 'map' or grid. My goal is to define specific areas - for example, if the value for $i or $j equals 1, it should mark the edge of my 'map' by setting the cell's class to 'edge', which curre ...

Position card action buttons at the bottom using Material UI

I have been working on an app using ReactJS and incorporating MaterialUI (for React) along with React Flexbox. One issue I've encountered is the struggle to position the card buttons at the bottom, which seems to be a common problem across different ...

Transmitting form data inputted by the user to a modal that resides in the same component, all without the need for child or parent components or

In need of a solution where users can input answers to questions and have all the entered data displayed in a popup alongside the respective question. If a user chooses not to answer a question, I do not want that question or any related information to be ...

Is the CSS content-visibility property compatible with background images?

Can CSS content-visibility and contain-intrinsic-size also be used with the background-image property, or do they only work with IMG tags? Will either of these properties have any impact on the following code snippet? <span id="image"> #i ...

Ways to display dynamic content within a div using Bootstrap's vertical tab through a click event in PHP

I have been working on displaying static content in a div using Bootstrap vertical tabs, similar to this: Link: However, I am facing an issue with showing dynamic content in a div using a Bootstrap vertical tab through a PHP click event. I have been try ...

Finding the file in a separate directory within the src path

In my projects directory, I have a folder named projects which contains both a game folder and an engine folder. Inside the engine folder, there is an engine.js file. My issue is that I want to access this engine.js file from my game.html file located in a ...

How can I incorporate a custom color into a preset navbar on an HTML webpage?

<div class="navbar-header"> <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" style="color: blue;" class="navbar-toggle collapsed" type="button"> <i class="fa fa-reo ...

What is the best way to position this container in the center of the

Is there a way to perfectly center this container both vertically and horizontally? I've attempted the method below without success. Unsure of what is missing: HTML: <div class="box"> <p>This is a sentence.</p> </div> C ...

Issue with React Ref: Invariant Violation when trying to addComponentAsRefTo

I'm encountering an issue while attempting to add a ref to a React component. The error message I'm seeing is as follows: invariant.js:39Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding ...