Get rid of irritating photo borders

It's a mystery to me why no one seems to have the answer to this question.

Take a look at . The spacer images are surrounded by borders. While I could use empty divs instead of spacer images, I'm using them here to make a point. This issue also occurs elsewhere on the site.

You can view an image of the borders HERE.

Despite trying different ways of using "border: none", it doesn't seem to make any difference. There shouldn't be a border on any of the images throughout my entire site.

Below is the HTML:

<div class="main_title">Friend Activity</div>
<div class="notifications_container"><img src="images/none.png" class="notifications_spacer"><a href="#"><img src="images/notification-prayer-0.png" class="notifications_button"></a><img src="images/none.png" class="notifications_spacer"><a href="#"><img src="images/notification-answer-2.png" class="notifications_button"></a><img src="images/none.png" class="notifications_spacer"><a href="#"><img src="images/notification-posts-1.png" class="notifications_button"></a><img src="images/none.png" class="notifications_spacer"></div>

<div class="main_title">Communication</div>
<div class="notifications_container"><img src="images/none.png" class="notifications_spacer"><a href="#"><img src="images/notifications-request-2.png" class="notifications_button2"></a><img src="images/none.png" class="notifications_spacer"><a href="#"><img src="images/notifications-comments-2.png" class="notifications_button2"></a><img src="images/none.png" class="notifications_spacer"><a href="#"><img src="images/notifications-messages-2.png" class="notifications_button2"></a><img src="images/none.png" class="notifications_spacer"></div>

And here is the CSS:

img {
   border:none;
}

.notifications_container {
    width: 100%;
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 14px;
}
@media and (max-width: 799px) {
.notifications_container {
    margin-top: 0px;
}
}
@media screen and (min-width: 386px) {
.notifications_container img {
    width: 20%;
    height: auto;
}

.notifications_spacer {
    width: 10% !important;
    height: 5px !important;
    border: none !important;
}
}
@media screen and (max-width: 385px) {
.notifications_container img {
    width: 26.66%;
    height: auto;
}

.notifications_spacer {
    width: 5% !important;
    height: 5px !important;
    border: none !important;
}

}

Answer №1

Why are images being used for spacing? Instead, consider creating a transparent gif or png to use instead of no image at all. The file images/none.png < does not even exist.

Answer №2

Modify the appearance to:

.notifications_spacer {
    width: 10% !important;
    height: 0 !important;
    border: none !important;        
}

Keep in mind that setting the height to 0 will not impact the functionality of a spacer image, and having a non-zero height appears to be influencing the outline.

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

Using JQuery to access options dynamically generated within Select elements

I am currently working on Select elements that are dynamically updated with new options at set intervals. My goal is to programmatically access these new options in order to check if a certain value exists within the select element. I attempted to use the ...

Issue with click function not activating in Chrome when using Angular 6

I am facing an issue where the (click) function is not triggering in my select tag when I use Google Chrome, but it works fine in Mozilla. Below is my code: <div class="col-xl-4 col-lg-9"> <select formControlName="deptId" class="form-control ...

Grid layout showcasing masonry gallery

I've spent some time looking for a Masonry gallery with a grid layout, but couldn't find one that suited my needs. So, I decided to create my own. I implemented a customElement with grid layout, but encountered an issue when trying to assign grid ...

An even flexbox grid featuring content of varying sizes and dividers

I am currently in the process of working on a .psd template and utilizing Bootstrap 4. I have encountered an issue with one section that contains multiple rows and columns with varying content. The main problem is with one column where the text inside the ...

Incorporate JavaScript functionality with HTML dropdown lists

I am attempting to achieve the following: The user can choose between "Option One" or "Option Two". If they select "Option One", the result will be 66 + 45, and if they select "Option Two", the result will be 35 + 45. How can I make this work using a com ...

How to retrieve nested menu items within the scope by utilizing JSON and AngularJS

I have recently started working with angular and am facing difficulty in accessing the submenu items within my angular application. While I can successfully access the top level menu items, I am struggling to retrieve the second level items. Here is a sni ...

Preventing the last letter from being cut off when using overflow:hidden

Check out this code snippet below... .panel { width:400px; overflow:hidden; background:lightgrey; font-size:30px; } <div class="panel"> This is a sample text to demonstrate the overflow property in CSS. We want to ensure that it do ...

Bootstrap 4: Organize 5 cards in a row with each line populated with cards

My Bootstrap setup looks like this: <div class="container"> <div class="row"> <div class="col-12 col-lg-3"> <div class="card mb-3 cardtrans"> // All the content for t ...

Is my understanding of HTML and JavaScript code accurate?

Explaining lines of code to my class for homework has been a challenge. I tried my best to break it down, but I'm not entirely confident in my accuracy. My grade depends on being 100% precise and detailed. <!DOCTYPE html> The first command dec ...

Steps for modifying the CSS style of a div element following an onclick event:

<html> <head> <style type="text/css"> .step_box { border: 1.0px solid rgb(204, 204, 204); border-radius: 10.0px 10.0px 10.0px 10.0px; } .step_box:hover{ background: rgb(184, 225, 252); } .selected { background-color : #fff000; ...

Ensure that a span within a cell table has a height of 100%

Is there a way to have the span element expand to full height? Click here <table class="table table-condensed table-hover table-striped"> <thead> <tr> <th class="shrink"></th> <th class ...

Tips for designing seamless pagination on a mobile-friendly website with responsive design

My goal is to make pagination easily accessible on mobile devices for users of my website, similar to UIScrollView with paging enabled in iOS. However, it's important that the website remains functional and visually appealing on desktops as well. I h ...

Vertically animating an image using jQuery

I have been experimenting with trying to make an image appear as if it is floating by using jQuery to animate it vertically. After some research, I stumbled upon this thread: Animating a div up and down repeatedly which seems to have the solution I need. H ...

The Bootstrap Input-Group with Spinner displays an unusual spinning shape that resembles the letter D

I am encountering an issue with a unique form that sends each line of input as a separate request upon submission. I am looking to add a spinner at the end of each line, but I am facing a problem where instead of a circular spinner, I am getting a spinning ...

Positioning two elements next to each other and keeping them aligned evenly

CSS - How to Float Two Elements Side by Side I am facing a similar challenge in achieving the layout I want. With a percentage-based layout, either my menu overlaps with the content or the content gets pushed below the menu when viewed on mobile devices. ...

Ways to eliminate unused classes from JQuery UI

We have successfully implemented JQuery UI library for enhancing our interface. However, since we no longer need to support outdated browsers like IE6, classes such as .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl are unnecessary and clu ...

What are some ways to apply selector combinators to hashed CSS module classes?

Seeking advice on overriding a style in a CSS module for a third-party datepicker component used within a custom component. The challenge lies in targeting the correct element with a selector combinator, complicated by the dynamic creation of class names i ...

Loading content dynamically with AJAX and enabling smooth page scrolling

Looking for a solution to this issue. I have a button on my webpage that, when clicked, uses AJAX to load content into a "div" element below the button. Everything functions properly except for one problem - every time the button is pressed, the page scrol ...

Generating PDF files from HTML documents using Angular

I am currently working on an Angular 11 application and I have a specific requirement to download a PDF file from a given HTML content. The challenge is that the HTML content exists independent of my Angular app and looks something like this: < ...

Initiate a page break at the beginning of the table in case there are not enough lines on the first page

Does anyone know how to ensure that a table starts on a new page when printing, rather than continuing at the bottom of the previous page? I have tables with repeating headers and many rows, and sometimes a new table will start at the very end of a page. ...