r/csshelp • • May 15 '22

text-align and writing-mode not working together

6 Upvotes

I have some basic text (h3) and I have added

writing-mode: vertical-lr;

to rotate the text. this rotates the text but if i add

text-align: right;

it doesn't align it to the right. if i remove the writing-mode and just have the text-align it will align it to the right but not be rotated. if anyone has any ideas or can help i appreciate it


r/csshelp • • Feb 24 '22

Request No matter what I try, h1 is bigger than h2

6 Upvotes

My css file text

My html is extremely simple:

` {% extends "base_layout.html" %}

{% block content %}

<div class="homepage">

<h1>Welcome!</h1>

<h2>Pick a page</h2>

</div>

{% endblock %}`

But no matter what I call in my css, I cannot make h1 and h2 the same size. I can change the sizes, but not hard code them to the same size!

I have tried:

h1.homepage, h2.homepage{

.homepage{

h1.homepage{ and h2.homepage{

and a few others. No dice. Inspect element isn't informing me of any great info...

Thank you!!


r/csshelp • • Feb 03 '22

Struggling to make a simple box... help?

6 Upvotes

Hi,

I'm new to webdev using html/css. (sorry if not in right sub)

Starting to learn, and I want to create a really simple thing.

Basically a responsive fixed box that never touches the viewport by 20px.

If you change the screen size, the box will always have a 20px margin, top, sides and bottom.

I don't want scrolling at all!

Then at the center, I want to place a .gif that is about 40em that scales according to screen size.

My problems until now, is that I can't make that box at all, I've tried dozens and dozens of different solutions I've lost track of which ones, I've got 30 tabs opened with tutorials but none solve my problem. I'm using https://jsfiddle.net/ to test the website.

Every try there is always a scrollbar, or the box has margins on top/left, but not bottom/right, or the gif is centered horizontally but not vertically, or there are margins but i can't control size of them....

My diagram: https://ibb.co/WxD8QfN

Is this so hard???

It would be awesome to have some directions, thank you!

This is what I currently have, but it's just one of the dozens of my failed attempts....

body {
  background: #f0e8e6;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

div {
    width: 90vw;
    height: 90vh;
    padding-top: 100px;
    padding-bottom: 100px;
    padding-left: 100px;
    padding-right: 100px;
    position: center;
    top: 50%;
    left: 50%;
    background: #ffffff;
    text-align: center;
    overflow: hidden;
}

r/csshelp • • Jan 05 '22

CSS newbie ugh

6 Upvotes

So... I'm a computer science student.

Basically, our software engineering professor made us develop a web app (we haven't ever done something like this, this exam is based on learning agile programming and stuff), so we're not really supposed to "know" how everything works.
But anyway, me and my group are learning Eclipse and Java Servlets etc. etc., but I have to do the frontend.

Aaaand here's the problem: I haven't ever touched css. Where do I start? I have like 20 jsp pages to style in 10 days and I don't even know where to look for help lmao


r/csshelp • • Sep 26 '21

Request Big amateur, but the gifs Im inserting on my web-store aren’t centering on the page. I tried what I thought would center them but no luck. Whats going wrong?

6 Upvotes

r/csshelp • • Sep 05 '21

Request Prevent a web page from switching into mobile view

6 Upvotes

How can I prevent this web site https://whatsmyip.com from collapsing into mobile view when my desktop browser window is sized below a certain width?

The web page seems to switch over to a mobile layout when the window gets below approximately 1240px wide, and I would like it to stay in normal Desktop view (either permanently, or at least until the browser window gets below 1000px wide).

I looked at the source code for the page, and I can see a class called .mobile and some @media {min-width: values with a few different widths, but I'm too inexperienced to know exactly how use them to prevent the page from switching to mobile view.

I'd very much appreciate some help.


r/csshelp • • Aug 20 '21

Request Newbie css help. block getting ignored when I add 1 line of code.

6 Upvotes

Hi All,

Not sure whats wrong so I figured I would ask. When I enter a line of code it completely negates the entire block. Everything looks correct on my end and its bugging me. I'm guessing the error is human and I'm just not seeing it but that doesn't make it any less frustrating!

HTML

<!DOCTYPE html>
<html>
<head>
<title>CSS Cheat Sheet</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="container">
<div class="box-1">
<h1>Hello World</h1>
<p>
                Lorem ipsum, dolor sit amet consectetur adipisicing elit. 
                Cupiditate libero laborum a quod odit deserunt porro, eaque corporis repellendus,
                nesciunt tempore ipsa eligendi tempora! Asperiores veritatis natus cum quis sit! 
                Lorem ipsum dolor, sit amet consectetur adipisicing elit. Commodi nobis rem fugit,
                nulla blanditiis voluptate accusantium tempora voluptas officiis architecto. 
                Repudiandae voluptas error ex reprehenderit fugit! Impedit minima amet libero!
                Lorem ipsum dolor sit amet consectetur adipisicing elit. Ullam quia amet est atque, 
                voluptatum perferendis optio nobis tempora dolore quisquam odio delectus et sunt 
                porro repudiandae? Fugiat et aliquam delectus?
</p>
</div>
</div>
</body>
</html>

CSS

body{
background-color:#f4f4f4;
color:#555555;
font-family:
    font-size: 16px;
font-weight:normal;
/* Same as above */
/* font:normal 10px Arial, Helvetica, sans-serif */
line-height:1.6em;
margin:0
}
.container{
width:80%;
margin:5px 10px;
}
.box-1{
background-color:#333;
color:#fff

}

when I add this line of code to the .box-1 class

border-right:5px red ;

all the css elements in .box-1 are ignored and it doesn't process the border. Any ideas on what I've done wrong?


r/csshelp • • Aug 01 '21

Request What are these weird selectors "'& > * + *"?

6 Upvotes

Was going through the React material-UI docs and came across these selectors

'& > * + *': { marginLeft: theme.spacing(2) },

Link here : https://material-ui.com/components/progress/

What are these selectors? (& > * + *)

Thanks!


r/csshelp • • Jul 23 '21

Searchign for a mentor

6 Upvotes

hey i m searching for a css /html /java scripts mentor for 1 on 1 , just need him to do some exercises (beginner level)with me


r/csshelp • • Jun 20 '21

Request Trying and Failing to Change the Font Color of the Menu Bar

6 Upvotes

I'm trying to change the font color of the menu bar on my sub. And by menu bar, i mean here.

I have no CSS experience. I culled together two attempts - here and here - both failed. The first produced an error and the second simply didn't work.

EDIT: My most recent updated attempt here.

I would be very grateful for any help the community could offer.


r/csshelp • • Jun 19 '21

Flexbox issue/confusion

6 Upvotes

https://codepen.io/RustyKumar/pen/QWpoQmy

I have a flex container and items are image and a div with long text.

Now I want that when text breaks in 2 lines, the empty space after text wraps to next line, should not be counted in div's width.

div's width should be constrained till last character of text and not the end of the parent container, like it happens when you create inline element, where its width is content width.

Let me know if its possible or how. Thanks!

Added end result too, in the pen and here https://prntscr.com/15y6xoz


r/csshelp • • Jun 12 '21

Where is the logic behind this?:

6 Upvotes

Hey, I'm new and I'm trying figuring out of this:

#log {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

Why doesn't the top 50% and left 50% actually make it center? And why do you need "transform: translate(-50%, -50%);" to make it center?


r/csshelp • • Jun 06 '21

Request How do I add Link Flair to my subreddit?

6 Upvotes

Apparently I have to have code that works for old and new reddit? I can't find out how. Please help me, thanks.


r/csshelp • • Jun 01 '21

Resolved [r/Grandorder] Banner Sizing on different Screen Resolutions

6 Upvotes

Hello, I have a 1920x192 px banner I would like to implement for my subreddit, but I have been having difficulty in making the length of the banner fill across the screen for all devices. I've made an attempt with the following CSS code but my Mod Peers with smaller screens have told me that it still cuts off. Is there any way that I can retroactively minimize height and extend width of the banner for smaller resolutions? Or perhaps there's a better solution?

#header {
    background-image: url(%%banner02%%);
    height: 210px;
}

@media (max-width: 1920px), (max-device-width: 1920px) {
	#header {
		background-size: auto;
		background-position:0 19px;
	}
}

This new banner is currently being tested/configurated on a test subreddit, so let me know if you want to be added to get a better look and idea.


r/csshelp • • May 16 '21

Resolved How do i change Highlights on "LOCKED" Threads

6 Upvotes

Highlights and text color on LOCKED threads

How do i change these colors?

Like this:

Image link


r/csshelp • • Apr 25 '21

Request How to color the reply button for comments of friends only?

6 Upvotes

Title. .reply-button is the target class I wish to adjust, but only for redditors added as friend. Unfortunately, the .friend class is not a parent of the .reply-button class so a simple .friend .reply-button {} doesn't do the trick.

Is there a way for a snippet to check for .reply-button only if the .thing parent also has a .friend child element?


Alternative interpretation:

Start with .thing .reply-button {} (or .thing .reply-button a {}) as basis, but add some code that checks if .thing has a .friend child. Is this possible?


r/csshelp • • Apr 17 '21

Layout messed up on ios browsers

6 Upvotes

I made a clone of reddit front page with react and reddit api, but its layout is messed up on ios. Anyone has any idea what could it be?

Code: github

Website: https://janxy-dev.github.io/react-reddit-clone/


r/csshelp • • Apr 06 '21

Is it possible to have something appear IN FRONT of a button but the button still be clickable?

6 Upvotes

I have a client asking for a hover effect that i would describe as a “shimmer” or “bubbles” effect in front of the buttons.

This would presumably be done by revealing a transparent animated gif or something like that on the parent element and using z-index to place it “on top” of the button on hover, but is it even possible to do this and still be able to click the button?

How would you go about implementing this request? Or is the only option to animate the “bubbles” on the parent element behind the buttons if they are to be clickable?


r/csshelp • • Mar 15 '21

How to create chrome tab like rounded edges?

6 Upvotes

Like here:

https://imgur.com/a/CftIfQB

I don't want to use svg for that, because I may want to change the colors of the selected tab, and I can't deal with filters for svg for selecting 'close enough' color.

Is there a way to do it in CSS/HTML?

Notice the rounded left side and right side

EDIT 1:

I mean like this:

https://imgur.com/a/9PyJqCL


r/csshelp • • Mar 08 '21

Resolved 24h formatting

6 Upvotes

Hi can someone help me with this? I’m trying to change this in 24h mode. Is that possible? This is the code:

- - Formatting - -

                            # Format times and dates
                            hours = d.getHours();
                            minutes = d.getMinutes();

                            if hours >= 12
                                ampm = 'pm'
                            else
                                ampm = 'am'

                            hours = hours % 12;
                            if hours == 0 # the hour '0' should be '12'
                                hours = 12

                            if minutes < 10
                                minutes = '0'+minutes # Append leading zero

                            timeStr = hours + ':' + minutes + ' ' + ampm;
                            if settings.monthBeforeDay
                                dateStr = (d.getMonth() + 1) + '/' + d.getDate()
                            else
                                dateStr = d.getDate() + '/' + (d.getMonth() + 1)
                            # End format times and dates

r/csshelp • • Feb 01 '21

Any tips on how to get a better feel for how to manage layout?

6 Upvotes

Positioning elements is still really difficult for me. Any tips on how to better understand how to manage the layout of your elements?


r/csshelp • • Jan 22 '21

Username overlapping on flairs in flair selection box, please help!

6 Upvotes

r/csshelp • • Jan 20 '21

Closed What's going on with my last row??

6 Upvotes

I have a 3x3 grid, but the items in the last row are spilling out. What's happening here?

http://menu.discover.earth/

Here's a screenshot so that you see exactly what I see

https://i.ibb.co/F8xL4q6/Screen-Shot-2021-01-20-at-2-46-21-pm.png

Here’s the code

https://codepen.io/discoverearth/pen/MWjxQdJ


r/csshelp • • Nov 20 '20

Bootstrap spinners not working

6 Upvotes

Hi all,

I'm learning bootstrap, and have copied the most basic code for a spinner from their documentation:

inside the <head> tag I import dependencies:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script src="js/bootstrap.min.js"></script>

<link rel="stylesheet" href="css/bootstrap.min.css">

and in the <body> tag I implement the spinner:

<div class="spinner-border" role="status"

<span class="sr-only"></span>

</div>

And I'm greeted only with a blank screen. I have no idea why this is happening, as other modules are working fine ( carousel, drop-down menus, etc.). I'm sure the framework files I'm importing are directing to the correct path, and the browser logs show no errors.

Help me please ;(

EDIT: Figured it out, I was using an old version of bootstrap (I know, I'm a noob). Was using 3.something whereas I now use 4.5.3 and it works .


r/csshelp • • Oct 31 '20

Resolved How do you make text not interfere with a div, or a div not interfere with text? There has to be something that prevents it, right?

6 Upvotes

Sorry, I'm learning CSS, and I want my first website to look good.