r/csshelp • • 13h ago

Resolved Cannot seem to get rid of spacing to the left/right of a floated image

1 Upvotes

US Navy squadron VF-19/191

I am floating a couple of images, one to the left and the other to the right.

However, there are big spaces between the left and right margins of the respective images.

I have tried margins and padding values of zero and 1px, but the big gap is still there.

The relevant section of CSS is as follows:

/*----------------------------------*/
/* banner */
.banner {
clear: both;
width: 100%;
margin: 0;
padding: 0;
overflow: hidden;
border: double #ffd700;
background-color: #263042; /*dark blue */
}

.box_left {
float: left;
width: 20%;
margin: 10px;
clear: none;
}

.box_centre {
float: left;
margin: auto;
width: 40%;
clear: none;
}

.box_right {
float: right;
width: 20%;
margin-right: 1px;
padding-right: 0;
clear: none;
}

/*----------------------------------*/

The HTML is:

<div class="banner">

<img class="box_left" src="https://satans-kittens.neocities.org/images/VF-19.svg" width="149px" height="46px" alt="VF-19"/><!-- 149x46 -->

<img class="box_centre" src="https://satans-kittens.neocities.org/images/titleBar.svg" width="691px" height="69px" alt="Satan's Kittens" /><!-- 461x46 -->

<img class="box_right" src="https://satans-kittens.neocities.org/images/VF-191.svg" width="163px" height="46px" alt="VF-191" /><!-- 163x46 -->

</div><!-- close banner -->

Ignore the ".box_centre", that is work in progress...

I have searched places like W3Schools and so on, but cannot seem to close the gaps.

What am I missing/doing wrong?


r/reddithax • • Jul 22 '23

Python/Selenium Script To Remove All Reddit Comments

Thumbnail self.learnpython
5 Upvotes

r/CSSTutorials • • Nov 30 '22

Happy Cakeday, r/CSSTutorials! Today you're 11

4 Upvotes

Let's look back at some memorable moments and interesting insights from last year.

Your top 1 posts:


r/cssnews • • Jun 20 '19

Ads are moving in feed on old Reddit

24 Upvotes

Subreddits using CSS on old Reddit should be aware of an upcoming change that will standardize ads across Reddit platforms. Starting next week, promoted posts (`.link.promoted`) will appear in feed. This may impact your styling if you have a custom style applied to (`.link.promoted`).


r/csshelp • • 5d ago

How to have two items side by side

2 Upvotes

Im trying to have two items right next to each other, one with a fixed width and another that changes width based on the first one. Is there any way I can do that? I'm still a bit of a beginner btw !


r/csshelp • • 6d ago

Request How to create this in HTML & CSS?

2 Upvotes

I'm looking a way to use plain HTML & CSS to create a feature from a TV program series called: Yu-Gi-Oh! GX.

This feature is called: LP Counter.

This control is used in Yu-Gi-Oh! Duels to represent the health of a player. If a player loses all their LP, they lose the Duel.

Here's the image for reference:

Here is a demonstration of the Yu-Gi-Oh! GX LP Counter https://img.yugipedia.com/7/7a/Life_point_counter_2.jpg

Here is another reference: https://www.reddit.com/r/yugioh/comments/1qm0ion/which_life_pointatkdef_counter_do_you_like_most/?i=2

I'm not sure if you are familiar with how the LP counter works, but, I would share the functionality:

By default, the value is 4000.
When the value is higher than 4000, the left level gauge will be blue - see the second link for reference - it says 4000.
When the value is lower than 4000, the left level gauge will lose its colors until its empty - see the first link for reference - it says 1300.

Maybe any of you are familiar with this feature and how it works, so, if anyone can please suggest some base code that can be used for reproduce this feature, I will be very appreciated.


r/csshelp • • 21d ago

Looking for a hand to understand My issue

2 Upvotes

Hi, I'm not good with coding what so ever just managed to change css code colors somewhat easily with my friends help, neither of us good are good at coding. If you could look at the code and tell me how I could make this be a legit thing with the colors id appreciate it!

I am not sure if it helps but the colors I used are:

.white-border {
    background: #faeeb7 !important;
    stroke: #faeeb7 !important;


.white-fill {
    fill: #faeeb7 !important;
}

    background: linear-gradient(to bottom, #f59454, #f8d17c);
    color: #faeeb7;
    border-radius: 16px;
    border: solid 4px #a56608;

.bottom-border .separator-1 {
    height: 4px;
    background: #a56608;
    border-radius: 10px;
    width: 100%;
}


.bottom-border .separator-2 {
    height: 4px;
    background: #a56608;
    border-radius: 10px;
    width: 100%;
    margin-right: 16px;
}

.username {
    padding: 6px 32px;
    background: #fff5de;
    border-radius: 64px;
    display: flex;
    color: #ffc549;

Just trying to give honey vibe ig :"D (also the code is just parts from the full code of ccs, it is in the link)

(this is a f2u chat widget. Link: https://vtuber-nook.com/asset/1039/f2u-heart-shaped-chat-widget-for-streamelements/ I take no claim of this I simply just wanted to make it more customized to my own needs) (and I'm sorry if this is really dumb I just need help and I have no idea how to even look this issue)


r/csshelp • • 22d ago

images in div inherit its opacity despite instructions otherwise

2 Upvotes

i have a div set to .9 opacity, which the images inherit despite my efforts to change the following css in multiple forms. i also happen to have pixelated image rendering for the whole page. when i tested by setting the style of a specific image to auto-rendering, it worked. the same method did not work with setting this same image to 1.0 opacity


r/csshelp • • 29d ago

Title: What's the most annoying CSS bug you've ever spent hours trying to fix?

5 Upvotes

CSS is funny sometimes. You can spend 20 minutes writing a layout, but then lose two hours trying to figure out why one element refuses to align properly.

Some particularly frustrating situations:

- Z-index not working because of a stacking context.

- Flexbox items refusing to stay aligned.

- A mysterious horizontal scrollbar appearing.

- position: absolute" breaking the entire layout.

- Margins collapsing unexpectedly.

- A media query fixing one screen size but breaking another.

- CSS animations behaving differently across browsers.

- An element overflowing its parent despite "width: 100%".

I'm curious:

What's a CSS bug that made you question your entire understanding of CSS?


r/csshelp • • Nov 03 '26

animation happening in series instead of parallel?

2 Upvotes

(edit - this is an issue specifically in safari. works properly in chrome.)

as far as i'm aware, the default behavior for css animation is to run everything in parallel. if that's the case, i'm completely confused why this is happening.

i have this css...

body {
	transition: color 0.3s ease-in;
}
.icon {
	transition:
		color 0.3s ease-in,
		border-color 0.3s ease-in,
		opacity 0.3s ease-in,
		background 0.03s ease-in;
}

but the color transition happens on the body followed by the color transition on the .icon elements.

there are no other transitions anywhere else in the css.

the colors for both are set in the css and not touched by javascript. the change is triggered by turning on or off a checkbox so it's purely css...

:root{
	--backgroundColor: hsla(var(--brandHue) 12% 9% / 1);
	--foregroundColor: hsla(var(--brandHue) 0% 100% / 0.8);
}
body:has(.mode:checked) {
	--backgroundColor: hsla(var(--brandHue) 12% 82% / 1);
	--foregroundColor: hsla(var(--brandHue) 0% 0% / 0.93);

}
body {
	background-color: var(--backgroundColor);
	color: var(--foregroundColor);
}

.icon has color: inherit and only changes when the body color changes. the other text on the page transitions first then the text with class .icon.

the desired behavior is for all text to change color simultaneously with a 0.3s transition.


r/csshelp • • Nov 02 '26

Request How to get rid of the massive gap over my chunk of text in a column?

1 Upvotes

I made the bg colour black so it would be more clearly differentiated. I made a few headings and gave them some individual attributes before putting them in an inline-block div. There's a gap over where the text first begins in the left column, and i have NO idea how to get rid of it. I'm a beginner, so any help would be appreciated! Also, if anyone knows how to get rid of the blue rim around the navigation bar at the top, that would be great too. thanks!

https://codepen.io/editor/issafizza/pen/01a19ca8-7846-70b4-925e-7174bb6b18f8

HTML: https://pastebin.com/raw/VZjC7M29

CSS: https://pastebin.com/raw/gKq8LtJD


r/csshelp • • Nov 01 '26

How to use CSS to replace (or appear to replace) text with a User's Input? (No JS)

2 Upvotes

I'm writing a reader-insert story and wanted to play around with the idea of allowing the reader to insert their own name directly from the story's page. The website I'm posting on doesn't (for obvious reasons) allow users to use JS, but HTML and CSS are supported. So I was thinking of doing something like:

Your name here: [Name]

"[John Doe] walked to the store." changes to "[Name] walked to the store."

Yes, I know there are extensions for what I'm asking for, but not everyone knows about them and trying to direct someone to install an extension is annoying for the reader. And yes, I know "it would be easier with JavaScript". ATP it's less about the story itself and more about solving this puzzle because not knowing is killing me.

I know it's possible in some form, I just don't know how to go about it. The way my brain has it structured is to have the CSS reference the code in the text box, so it would either change automatically (idk how that would work) or to have an "invisible checkbox workaround" to change the state of the name, but again I don't know how to tie the input to the CSS to go about it that way.


r/csshelp • • Oct 29 '26

No scroll on landing page CSS not working

Thumbnail
1 Upvotes

r/csshelp • • Oct 26 '26

Is asking for a css design here allowed?

0 Upvotes

r/csshelp • • Oct 12 '26

Request How can I filter an array of objects based on a specific property?

3 Upvotes

I'm stuck on an assignment. I have an array of objects, and I need to filter it by a certain property value. I thought I could use the `filter` method, but my output doesn't match my expectations. I'm checking if one property equals a certain value, but I keep getting more results than I should. Is there a common mistake I could be making? Any help would be great!


r/csshelp • • Oct 02 '26

How do I replace the Reddit logo in old Reddit with another image?

2 Upvotes

When I try following the tutorials on the internet, it always gets me on the same bug: The logo is WHITE for no reason! Can anyone here help? This is for my sub r/incorrectfactorial! Also, visit the sub r/incorrectfactorial in old.reddit.com, when I mean the CSS stylesheet is terrible!


r/csshelp • • Sep 23 '26

Should a beginner learn Flexbox or CSS Grid first?

5 Upvotes

Hi everyone! I am learning HTML and CSS as a hobby. I can create a basic webpage, but I want to make my layouts responsive on different screen sizes.
I have practiced a little Flexbox, but I have not learned CSS Grid yet. My goal is to create a small business website with a navigation bar, service cards, and a contact section.
Should I focus on Flexbox or CSS Grid first? What small practice project helped you understand it?
Thank you for your advice!


r/csshelp • • Sep 23 '26

Request Weirdly sized items in CSS Grid

1 Upvotes

Hey guys, beginner here. I was wondering if there's any way I could adjust a CSS grid to accomodate for differently sized items, without using span or areas. These items will be a size that I don't know.


r/csshelp • • Sep 10 '26

Facebook messenger - how to change colors of ephemeral on-hover date bubble

3 Upvotes

I'm using Vivaldi, based on Chromium, in its Dark Mode. Consequently the time/date bubble that pops up when hovering over a message in Facebook Messenger shows light text on a light background, therefore is not discernible. Using local css, I would like to shift either foreground or background to make for some contrast.

The problem is that the bubble disappears whenever I try to Inspect it. I have seen various techniques, and I haven't been able to get them to work - freeze scripts using F8, inspect via :hov or 'emulate a focused page'. I'm sure one of these is the right way, but I'm not getting it.

The base url here is https://www.facebook.com/messages. You would need a conversation with someone in order to have posts to see what's going on.


r/csshelp • • Aug 21 '26

Image gallery on click

5 Upvotes

Hi ! I'm trying to create a gallery of image. The idea is to have the first image visible, and then when you click on it, it changes to the second image, same thing for the third image, etc. When clicking on the last image, it would go back to the first one, creating a loop.

Is there a way to do that using html and CSS ? I'm a beginner and i don't know any other coding languages


r/cssnews • • Apr 09 '19

Upcoming DOM Change: Post/Comment Awards

44 Upvotes

As early as next week, we will begin releasing an update to awards on old Reddit. In summary, we will be replacing the “gilding-bar” span on each post / comment with a similar “awardings-bar”, including moving the award icons into <img> tags contained within <span> tags.

More specifically, the “gilding-bar”, which used to look like this:

<span class="gilding-bar">
    <a>
        <span class="gilded-gid1-icon" data-count="7">7</span>
    </a>
    <a>
        <span class="gilded-gid2-icon" data-count="2">2</span>
    </a>
    <a>
        <span class="gilded-gid3-icon" data-count="1"></span>
    </a>
</span>

Will transform to look like this:

<span class="awardings-bar" >
    <a class="awarding-link" data-award-id="gid_3" data-count="1">
        <span class="awarding-icon-container">
            <img class="awarding-icon" src="...">
        </span>
    </a>
    <a class="awarding-link" data-award-id="gid_2" data-count="2">
        <span class="awarding-icon-container">
            <img class="awarding-icon" src="...">
        </span>2
    </a>
    <a class="awarding-show-more-link" >&amp; 7 more</a>
</span>

The accompanying CSS for the new element will be:

.awardings-bar {
   margin-left: 4px;
   &:empty {
       margin: 0;
   }
}
.awarding-link {
   margin-right: 4px;
   &.hide-award {
       display: none;
   }
}
.awarding-icon-container {
   display: inline-block;
   height: 12px;
   width: 12px;
   margin-right: 2px;
}
.awarding-icon {
   max-width: 12px;
   max-height: 12px;
   vertical-align: -2px;
}

If you have any questions or feedback on how the change has affected your CSS, let us know!


r/csshelp • • Aug 14 '26

Request Desperately need help getting this thing centered.

2 Upvotes

Hello guys!

I really need help getting that streaming element centered, its stuck to the right and i tried everything to no avail 😭

And adjust the lightning frame so its at the edges of the element (it is, but the top part look off a few px).

Here is the code in question;

https://docs.google.com/document/d/1kvfcEklrjnN9VMOec2lgvHROh7nniwWDrrsqxjNvIQM/edit?usp=drivesdk

Its for a page on comicfury, here's what is looks like right now;

https://meteor.thecomicseries.com/Tedt5

Thanks!


r/csshelp • • Aug 03 '26

Spacehey invite code

Thumbnail
0 Upvotes

r/csshelp • • Jul 21 '26

Request rem vs em vs px vs vh... I’m losing my mind. How do you actually decide which CSS unit to use?

14 Upvotes

Hey everyone,

I’ve been learning web development and CSS for a bit now, but I keep hitting a wall when it comes to picking the right CSS units.

Every tutorial seems to say something slightly different:

  • One video says "Never use px for fonts, always use rem for accessibility!"
  • Another video uses em for paddings, but then my nested elements balloon into giant monstrosities because of compounding.
  • Then someone else says to use vw/vh for fluid layouts, but my text overflows or acts weird on mobile screens.
  • And % works great... until it acts relative to something unexpected.

Right now, I feel like I'm just guessing, refreshing Chrome DevTools, changing units until it "looks fine," and hoping it doesn't break when I resize the window.

For those who write CSS professionally or comfortably:

  1. What is your actual, real-world rule of thumb for when to use px, rem, em, %, and vw/vh?
  2. Are there specific properties where you always stick to one unit (e.g., font-size, margin, padding, max-width, border)?
  3. How do you handle responsiveness without making a mess of CSS variables or media queries?

Would love to hear how you mental-model this so I can stop guessing! Thanks in advance.