Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial landing page design #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

unswdata
Copy link

@unswdata unswdata commented Apr 8, 2024

No description provided.

height: 100%;
background-image: url('./hackerWaterfall.png');
opacity: 0.2;
z-index: 0; /* Ensure the background layer is behind content */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting z-index to 0 (and then setting everything everywhere else to 1) you can set it here to -1. This is only ok since this is just a background. This helps you avoid setting every other element's z-index to 1 (note: the default value for z-index is 0).



.center-grid-container {
display: grid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan of using flex to just center elements over grid... but this works

<div class="grid-fill-item"></div>
<div></div>
<div></div>
<div></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unavoidable I guess, since you want the grid layout...
Not sure if adding a dummy class called like 'bg-transparent' or something to each blank div adds readability or adds dead code (probably the latter)

<p class="username">login&gt;<span>_</span></p>
</div>
<div">
<p class="headingStuff">CMS PORTAL</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be a h1 -- using the right semantic HTML tags help code readability and SEO

height: auto; /* Maintain aspect ratio */
fill: white; /* Set fill color to white */
z-index: 2;
position: absolute;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid over-relying on position: absolute for positioning... you can think of position: absolute is an "escape" from the standard object-flow which is generally expected and to be only used where an element must be positioned in a absolute position relative to something else.
Position absolute also breaks down quickly when you try to code for responsiveness; once you resize the browser window, weird stuff may start happening (but obviously that's not a present concern).

text-align: right;
vertical-align: text-top;
font-size: 26px;
position: relative;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try not to force position with position:relative. Mess around with padding, gap and margin instead.

The main use case of position:relative is just on parents of position:absolute elements... honestly don't see it used much else.
https://css-tricks.com/absolute-positioning-inside-relative-positioning/

}


span{
Copy link
Contributor

@JoshCLim JoshCLim Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a larger project you would use a classname instead of affecting spans everywhere with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants