How do people create websites that can scroll down and have different color for each sections?

I've been trying to figure this out and I have had no luck
586 Replies
RMON
RMONOP12mo ago
I'm trying to create myself a portfolio (not a good one) But since Im still learning Im running into multiple issues for starters I want to create a portfolio that has difference sections. First Section = Main Page (Introducing Me) Second Section = About me Third section = Projects Fourth sections = Contact Info I tried one thing where I add a few sections (four to be exact) then adding a min-height of 100vh but it doesnt seem to be equal lenghts so it looks bad
Zoë
Zoë12mo ago
I know Kevin has a perfect video about this, in a much smarter way than just making each section min-height: 100vh (which should be equal as long as the content isn't taller and padding isn't more than 100vh. Going to find the video
RMON
RMONOP12mo ago
Alright thank you!
Zoë
Zoë12mo ago
Kevin Powell
YouTube
A new approach to container and wrapper classes
The wrapper or container is probably the most common design pattern around, but after coming across an article by Stephanie Eckles looking at how we can use a grid to emulate a container, and have simple breakouts — https://smolcss.dev/#smol-breakout-grid — I had an idea of how we could do this to completely drop the idea of containers, and then...
Zoë
Zoë12mo ago
You will want to do this with min-height: 100vh, if you want them all to be equal you should be able to use grid and have them all 1fr however that would look strange to have the smallest stretched out to match what you can't see
RMON
RMONOP12mo ago
The way my code is currently is that theres a man div inside of it the header and all that to style the nav but for some reason when I scroll down to the other page I have the heights aren't equal I've given a main min-height to affect all the sections but for some reason it just doesn't work properly
Zoë
Zoë12mo ago
Sorry I edited my message about using 1fr for rows rather than post it. I'm just not sure why you would want them to be equal when the content is not equal
RMON
RMONOP12mo ago
I can send you the code pen to it, It's pretty starter so it doesn't have much As said it doesn't really look good
Zoë
Zoë12mo ago
The heights are equal (you're using height: 102vh, changing it to min-height: 100vh and it's still equal)
RMON
RMONOP12mo ago
I tried using height: 100vh but it didnt do much For example when I scroll down to the second part (ignor the coloring its just so I can see)
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
It has the red section part peaking
Zoë
Zoë12mo ago
That's because there's a bit of white off the top of the screen, it's only an issue if you can see 3 sections at once, seeing 2 is normal
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
Even in the red section the green peaks out
Zoë
Zoë12mo ago
No description
RMON
RMONOP12mo ago
? How does it look normal for you
Zoë
Zoë12mo ago
I middle clicked scrolled. When you scroll you move by 100px, if the view is not a multiple of 100px then it won't perfectly align Could look into scroll-snap-align, I've only touched it once but I hate scroll hijacking
RMON
RMONOP12mo ago
I actually did try it and I wont lie it did annoy me, If it feels like a cheat to avoid the problem Im having when I know theres a correct way to do this Plus it feels forced, the user cant scroll for themselves so how can I fully fix this situation so it looks clean and each page fit's into the screen nicley
Zoë
Zoë12mo ago
Personally I'd avoid having sections be a minimum of 100vh It doesn't flow as well especially for a portfolio It makes every section the same level of importance
RMON
RMONOP12mo ago
So how can I make my entire page scrollable to have different sections talking about different thing?
Zoë
Zoë12mo ago
Just don't set a min-height/height and have the sections as they are (block) First and last sections could be min-height: 100vh however (with last section sharing the full height with the footer, it's expected that you'd have a contact form which can easily take up the full height). With those the alignment of scrolling to the top and to the bottom is fixed and so it will look clean I personally don't like the first section to be 100vh unless there's an affordance, something to show that there's more when someone scrolls down (rather than an icon telling the user to scroll down)
RMON
RMONOP12mo ago
Whats a good height to have for the first section? The front page wont have much apart from the Nav bar some text and two buttons where should I add block and the min-height?
Zoë
Zoë12mo ago
I go something like max-height: calc(100vh - 6rem) (change the 6rem to whatever looks correct) or just bring the siblings up. An affordance is where you only see the edge of something telling the user to scroll or swipe in that direction to go to it/see what it is You don't need block as section already is. min-height on :first-child and :last-child
RMON
RMONOP12mo ago
would it be fine to add "max-height: calc(100vh - 6rem)" in the section I have
Zoë
Zoë12mo ago
Yes, but additionally use box-sizing: border-box on the section because the height will then account for padding it may have
RMON
RMONOP12mo ago
I added the max-height and box-sizing my section{} it caused the page to look like this
RMON
RMONOP12mo ago
No description
Zoë
Zoë12mo ago
https://codepen.io/z-/pen/MWxeLBM/98a0265d3e1a3a92410005e04c814273?editors=1100 this is an example of what I'm talking about (also I'm using Pug and Stylus for my HTML and CSS because it's easier, if you want to see plain HTML and CSS click the v chevron to the right of the headings and click "view compiled")
Zed Dash
CodePen
MWxeLBM
...
RMON
RMONOP12mo ago
Sorry for the delay Im gonna try this out and get back to you yea Im not fully understanding this cant wrap my head around it
Zoë
Zoë12mo ago
The easiest option design and implementation wise is to just make the first section box-sizing: border-box; min-height: 100vh; and then add a chevron pointing down or a scroll animation at the bottom of the section (easiest way to do this is to add an extra padding to the bottom of the section and then grab a down chevron from Font Awesome and then absolute position it position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);)
RMON
RMONOP12mo ago
alright, thank you!
RMON
RMONOP12mo ago
Oh wow, I didn't expect you to do it for me 😆 Thank you! Another quick question, Let's say I start designing the other sections you've added would there need to be a specific height given to it or would I just design the website and let it change height on its own as Im adding content?
Zoë
Zoë12mo ago
It would change to fit the content
RMON
RMONOP12mo ago
Oh I see the reason I tried adding a specific height is because I didnt know people who create websites just have that section tiny and allow the website to grow in size on its own I thought they added a specific height to it so they can design it in there
Zoë
Zoë12mo ago
Ohh I see, yeah web design is different in that regard, you don't often restrict the size of things because what you're making has to display at different resolutions with different font sizes and with different aspect ratios. So it's very fluid. 9 times out of 10 where you may want height you actually want min-height and 9 times out of 10 where you may want width you actually want to not specify anything about the width Lots of sizes are implicit
RMON
RMONOP12mo ago
Oh I get what you're saying this entire time I thought I'd have to create a specific size and style inside I didnt know I would have to just style and create thing in the small height and let it grow on its own
Zoë
Zoë12mo ago
Fair, it is something that beginners often have difficulty with and something you will pick up quickly while building
RMON
RMONOP12mo ago
The main reason Im even making a portfolio at this skill level with not much knowledge (Im still in school) and I got the oppertunity to head to Snapchat's HQ and I was hoping by then I can have a decent portfolio with maybe 3 projects and hopefully get some sort on internships or even be on their radar
Zoë
Zoë12mo ago
Oh cool, that's a good opportunity I hope you can wow them
RMON
RMONOP12mo ago
I hope so too, Just the fact that my skills limited so it wont be anything impressive just hope they can see I have the drive for it and help me out Do you recommend any good beginner projects?
Zoë
Zoë12mo ago
I think the best way to learn something is to copy, but copy from memory, so you have a clear idea of what the goal is but you're not allowed to get bogged down on everything being exact, there will be differences and there will be problems but you can solve them. Optionally if there's anything you wish that the original website had but doesn't have then add it. You would likely need to reduce the scale of things and simplify, if you were to make a Twitter clone just skip over doing auto-complete and highlighting mentions and tags (working with text in that way is tricky). Additionally Dribbble has a lot of web designs which you can recreate as long as you credit the creator and link to their work. The goal is to just make things and it helps when the design or the vision is already made for you. Personally I would avoid jumping into websites and instead focus on components because if all of your experience is from making whole websites it means that you get a lot of experience laying things out but you don't have as many opportunities to play around with fun things like buttons, many projects will die before you get to it and when you do make buttons you'll be in the mindset of just getting something that does its job.
Trending Website, Landing Page and Splash Page Designs on Dribbble
Explore popular website and landing page designs on Dribbble, your best resource to connect with creative professionals worldwide.
Zoë
Zoë12mo ago
Blogs are probably a good beginner project, it really gets you into the mindset of everything in web design revolving around text, for better or for worse. Also don't worry about implementing a backend, the blog can just have static example content If you want to add in interactivity you can do a lot with a todo list, they can start really simple and the complexity can be added and added with no bounds
RMON
RMONOP12mo ago
I have a quick question, So abit ago I made a landing page (very simple) for Dr.Pepper but the thing I realized is other people who use the websites can see the img's how can I have that work?
Zoë
Zoë12mo ago
One thing I can recommend avoiding is weather and calendar, at least for a beginner project at least don't make it functional. Getting weather is complicated, and dates are also difficult. However doing them as static (or for weather having buttons to change the weather) is fine
RMON
RMONOP12mo ago
The reason I've avoided them is because they require API'S which I have no idea how to use
Zoë
Zoë12mo ago
You need to upload the image to where it's publicly accessible, for instance you could upload it to Discord or imgur and then right click and copy link (not copy message link) and then use that. It's not allowed and places like imgur will say that you aren't allowed to do it but they have the option to block hotlinking if they really didn't want people to do it. I haven't looked into Discord ToS for if hotlinking is disallowed but they also haven't blocked it so as long as you don't have thousands of visitors a day it's permissible. If you click the Assets button bottom left are you able to upload any images on a non-Pro account? I don't know if that's a Pro feature or not, if having Pro just increases limits. Otherwise you can get a domain for $10/year and hosting for $2/month and then set up your own CDN (I have https://i.koya.io/ I can stick anything and you can then use Cloudflare to have the image cached all around the world to be fast)
RMON
RMONOP12mo ago
Alright I appreciate it
Zoë
Zoë12mo ago
https://imgbb.com/ they explicitly allow direct image linking, they have paid accounts but if you're only uploading a few images for developing then you're going to be fine
ImgBB
Upload Image — Free Image Hosting
Free image hosting and sharing service, upload pictures, photo host. Offers integration solutions for uploading images to forums.
RMON
RMONOP12mo ago
Ok I actually figuered something out If you add your code and images onto GitHub and then go to the "pages" in their settings you can use thier domian and make your sit live https://arman-markaryan.github.io/Dr.Pepper/ This is the one I created as a landing page for Dr.Pepper The buttons are clickable but don't lead anywhere
Zoë
Zoë12mo ago
Ah yeah GitHub Pages, a lot of people use them for their personal sites
RMON
RMONOP12mo ago
You think it's reliable?
Zoë
Zoë12mo ago
I've never used it but I haven't heard bad things and people do keep using it so it's probably good
RMON
RMONOP12mo ago
alright cool one more thing, let's say i want my page to redirect someone for example a "learn-more" would it be ok making a new website on VS desining it putting it on GitHub and linkinng it like that?
Zoë
Zoë12mo ago
Yeah, you could have multiple projects as their own page and then link to them on your portfolio
RMON
RMONOP12mo ago
Hey one more thing (outside of code ig) I tried making a logo and it worked out well it had a transparent background and everything but I realized it still had it's pixels of 400x400 how can I change that or make it better so its much smaller?
Zoë
Zoë12mo ago
You can either resize it in an image editor like paint.NET or use something like (ezgif)[https://ezgif.com/resize] (it supports more than GIFs) you can first resize and then there's a button with a drop down saying "convert" (it chains with the convert so you don't need to save first) and you want to select WebP, and this will reduce file size by at least a half
Paint.NET - Free Software for Digital Photo Editing
Paint.NET is free image and photo editing software for computers that run Windows.
Animated GIF resizer (free online tool)
Simple and free tool to resize (scale) animated images online. Resize animated GIF, WebP, APNG, AVIF images without losing the animation and quality.
Zoë
Zoë12mo ago
WebP is amazing
RMON
RMONOP12mo ago
Alright, By chance can this make backgrounds transparent? I feel like these websites could make my pictures cleaner
Zoë
Zoë12mo ago
You want to make it transparent when creating the logo rather than afterwards ideally
RMON
RMONOP12mo ago
I'd just like to make the background of it transparent
RMON
RMONOP12mo ago
No description
Zoë
Zoë12mo ago
I know and the easiest time to do that is when making the logo, not afterwards
RMON
RMONOP12mo ago
Thats the logo I created, It's just that I'd like to get rid of the Grey Part I was able to use Pixlr to remove the background color but I felt like it didnt look polished
Zoë
Zoë12mo ago
For logos like that your best bet is SVGs either using Adobe Illustrator (paid) or InkScape (free) or any other "vector graphics software"
Draw Freely | Inkscape
Inkscape is professional quality vector graphics software which runs on Linux, Mac OS X and Windows desktop computers.
RMON
RMONOP12mo ago
alright, thank you Honestly you guys have so many information I dont know how you guys do this.
Zoë
Zoë12mo ago
I've been doing this for over a decade now
RMON
RMONOP12mo ago
Damn Ok would it be possible for you to check out the other thead I created? It's regarding obtaining a job and what it's like https://discord.com/channels/436251713830125568/1194482494855204974 And if you have any other info you're willing to answer so I can understand more regarding it that would be amazing
Zoë
Zoë12mo ago
My work is a little bit strange, like it's been many years since I made a website, I'm more a details person, I like to solve problems. My work isn't exactly typical and on top of that I've been unable to work for a few years so I'm a bit out of what's current
RMON
RMONOP12mo ago
If you dont mind me asking how come you haven't worked? Is it regarding how the job is? I'm just tryna see if the job is for me Ive seen people talk good about the job and bad so im tryna get a more realistic view apart from YouTube
Zoë
Zoë12mo ago
Here's your logo as an SVG (you can treat this as an image and link to it the same way you'd link to another image, or you can copy and paste the code into HTML as it is just HTML), I just traced it, another useful website for when you get into making your own is SVG OMG which helps in minifying SVGs so they're even smaller (reduced from 600 bytes to 431 bytes for this logo)
SVGOMG - SVGO's Missing GUI
Easy & visual compression of SVG images.
RMON
RMONOP12mo ago
Yea, I'm definetly gonna have to keep these websites
Zoë
Zoë12mo ago
Oops I messed up the SVG a bit
RMON
RMONOP12mo ago
Do you have any extra tips or anything that could help me continue learning and get better?
Zoë
Zoë12mo ago
RMON
RMONOP12mo ago
Another question (apologies for bombarding you with so many of em) This is the current structure I have where would I place the SVG? Im asking because I've seen people place their logo in difference spots which I found odd <section class="Landing-Page"> <header> <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">About Me</a></li> <li><a href="#">Projects</a></li> <li><a href="#">Contact Me</a></li> </ul> </nav> </header> </section>
Zoë
Zoë12mo ago
In the header is ideal, but specific placement is up to you
RMON
RMONOP12mo ago
It probably does, But is it a big difference on the placement
Zoë
Zoë12mo ago
Not really
RMON
RMONOP12mo ago
Alright, Thank you! Honestly I wouldn't be in the current place if it wasn't for the help you and hart have given
Zoë
Zoë12mo ago
I should be asleep, 4AM, feel free to ask more questions, but I'm likely going to be busy tomorrow and so if there are any questions here that nobody else answers I'll be around to answer them <t:1704909600:R>
ἔρως
ἔρως12mo ago
when using your logo, i very strongly recommend that you hand optimize the svg after you use the automatic tools, and then make a symbol out of it
RMON
RMONOP12mo ago
How can I go about doin that?
Zoë
Zoë12mo ago
MDN Web Docs
SVG: Scalable Vector Graphics | MDN
Scalable Vector Graphics (SVG) is an XML-based markup language for describing two-dimensional based vector graphics.
ἔρως
ἔρως12mo ago
the hand optimizing comes from f*cking about and finding out
RMON
RMONOP12mo ago
W
ἔρως
ἔρως12mo ago
you can, for example, put all paths into as few <path> elements as possible avoid css like the plague - but not like covid
RMON
RMONOP12mo ago
I get what you're sayin Love the examples 😂
Zoë
Zoë12mo ago
SVG code looks really complicated and while it is complicated it's not impossible to read. However the SVG is 430 bytes and I wouldn't worry about it
ἔρως
ἔρως12mo ago
i only saw the 700 bytes one, and there is a lot that can be trimmed
RMON
RMONOP12mo ago
Alright one day I'll be able to read it
ἔρως
ἔρως12mo ago
and improved as well like, the white areas being transparent instead of being white
Zoë
Zoë12mo ago
I fixed that
RMON
RMONOP12mo ago
The logo it self the represents my Initials and the border would be white, everything else would be transparent to fit the background of the page
ἔρως
ἔρως12mo ago
i didnt see the other one, im on a phone
Zoë
Zoë12mo ago
Also SVG OMG says 430 bytes but yeah the file says 720
ἔρως
ἔρως12mo ago
maybe it gave you the wrong svg? because what you sent is very nice and indented svg instead
Zoë
Zoë12mo ago
I left the indents as it makes it easier to read to manually tweak before minifying
ἔρως
ἔρως12mo ago
that makes sense but as i was saying, you should consider using a <symbol> instead of throwing the svg in there
RMON
RMONOP12mo ago
Hey sorry to interupt I have a quick question, I don't have a specific padding on my code yet it's being affected? Nvm Nvm We're not gonna speak about the fact I just figured it out after sayin I didnt figure out
Zoë
Zoë12mo ago
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol this is how you do that (the <symbol> and the <use> don't have to be in the same SVG, you would usually have an SVG at the top with the attributes height="0" width="0" role="none" tabindex="-1" style="position:fixed;" just so it doesn't affect anything and every browser knows to ignore it, and then elsewhere you have an svg with a symbol)
MDN Web Docs
- SVG: Scalable Vector Graphics | MDN
The element is used to define graphical template objects which can be instantiated by a element.
RMON
RMONOP12mo ago
Back to SVG talk.. 🙃
ἔρως
ἔρως12mo ago
somewhere, on the document, create an svg like this:
<svg style="position:absolute;z-index:-1;width:0;height:0;visibility:hidden">
<symbol id="logo" viewBox="...">
<!-- content comes here -->
</symbol>
</svg>
<svg style="position:absolute;z-index:-1;width:0;height:0;visibility:hidden">
<symbol id="logo" viewBox="...">
<!-- content comes here -->
</symbol>
</svg>
RMON
RMONOP12mo ago
Alright, I haven't been caught so just a quick explanation what would be the difference between this and the original SVG
ἔρως
ἔρως12mo ago
DO NOT set the svg to display none, or animations break instead of pasting 400+ bytes everytime, you use the symbol
RMON
RMONOP12mo ago
I getchu
Zoë
Zoë12mo ago
Even if you only use it once it's also much nicer HTML to deal with
ἔρως
ἔρως12mo ago
yup usually, people use logos twice: once on the header and footer
RMON
RMONOP12mo ago
which I'll most likely be doing
ἔρως
ἔρως12mo ago
this saves you A LOT of headaches, and you just have to <use href="#logo"/> and done inside an svg, obviously
Zoë
Zoë12mo ago
I have FontAwesome Pro so I can just add my own symbols and have them cached and it's easier to deal with and it's 400 bytes once 😊
ἔρως
ἔρως12mo ago
i prefer to use bootstrap icons, as the symbols are 50-70% smaller but same principle applies
Zoë
Zoë12mo ago
Do bootstap icons allow making sets/kits? I can select a group of icons to include so while icons may be bigger (trusting you, I've never looked) the font that browsers loads only includes the fonts that I am using
ἔρως
ἔρως12mo ago
no, you get a font file with all icons or you can yoink the svg on the website
Zoë
Zoë12mo ago
So benefit with FA that you don't download more than you need You can download the SVGs from FA too
ἔρως
ἔρως12mo ago
yes, but you download a lot anyways
Zoë
Zoë12mo ago
We were talking about minimising sizes
ἔρως
ἔρως12mo ago
yes, but font awesome is still a bit chunky even when you download a separated specific set of icons however, it has A LOT more icons
Zoë
Zoë12mo ago
The icons for one of my websites is 4.13KB and this has around 12 icons (including 2 custom) and it'll be gzipped and cached by the browser, pretty small
ἔρως
ἔρως12mo ago
that is pretty small, depending on the icons i have 32 icons and it is about 3-4kb as well i think but i optimized the living hell out of the icons both manually and automatically
Zoë
Zoë12mo ago
Standard home, dots, question mark, and custom icons that aren't as optimised as what FA does (never actually used stellar in the end)
No description
ἔρως
ἔρως12mo ago
that stellar one looks like it would be a pain to optimize i use a lot of those, like settings and hamburger menu and stuff
Zoë
Zoë12mo ago
A little bit
ἔρως
ἔρως12mo ago
the best i made was my animated loading svg, which was a pain and a half
Zoë
Zoë12mo ago
Milk logo is still one of my favourite logos https://dribbble.com/shots/13397799-milk-logo
Dribbble
milk logo
ἔρως
ἔρως12mo ago
it looks good now i want cereal, at almost 5am
Zoë
Zoë12mo ago
It is, welp, I'm going to make it into bed before 5am
ἔρως
ἔρως12mo ago
i cant sleep dont know why, but i love optimizing svgs 🤷 by the way, did you set the fill to currentcolor?
RMON
RMONOP12mo ago
Hey guys I have a side question that doesn't revolve around VS
ἔρως
ἔρως12mo ago
or you left as default?
Zoë
Zoë12mo ago
But it's not my favourite https://dribbble.com/shots/11354324-Dolphin-logo it's made only from circles and 1 rectangle. I love creating with vectors
Dribbble
Dolphin logo
RMON
RMONOP12mo ago
Did I place these correctly? nav ul { list-style: none; float: right; margin-right: 30px; } nav ul li { display: inline-block; line-height: 80px; margin: 0 15px; } nav ul li a { color: var(--main-text); text-decoration: none; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 1.35em; }
ἔρως
ἔρως12mo ago
that is pretty
RMON
RMONOP12mo ago
This is really nice
Zoë
Zoë12mo ago
I didn't but that's a good move
ἔρως
ἔρως12mo ago
i do that on mine, by default DO NOT USE FLOAT 🤮 use flexbox
Zoë
Zoë12mo ago
Was just about to say that
RMON
RMONOP12mo ago
How come ?
ἔρως
ἔρως12mo ago
its awful breaks everything wasnt made for layouting wrong tool for the wrong job causes the parent to lose its dimentions causes headaches with everything you arent clearing it, so, im surprised it works at all
Zoë
Zoë12mo ago
It used to be that float was the only way to move things around without magic numbers, but since then we've got better tools so now you will find float: - Images inside text allowing text to flow around it like on Wikipedia I can only think of 1 time that it's not only being used but is actually good for the job, although there is an alternative now I think and you can also have the area around it a different shape not just rectangular
RMON
RMONOP12mo ago
So I should just remove float and add flexbox?
ἔρως
ἔρως12mo ago
yes that is the only use where floats must be used. all other times, its awful
RMON
RMONOP12mo ago
So Display: flex; and justify-content: flex-end; would be fine right?
ἔρως
ἔρως12mo ago
yeah, and a gap too
RMON
RMONOP12mo ago
how come gap?
ἔρως
ἔρως12mo ago
so the li doesnt stick together and there is space between each
RMON
RMONOP12mo ago
oh I see
ἔρως
ἔρως12mo ago
a gap of 5px should be good
RMON
RMONOP12mo ago
alright thank you!
Zoë
Zoë12mo ago
I'm glad I started web development just after float and clear stopped being the only way to do things, flexbox was brand new when I started in 2011 ish
ἔρως
ἔρως12mo ago
i suffered through floats never again
Zoë
Zoë12mo ago
I'm sorry
ἔρως
ἔρως12mo ago
floats are so bad that i would rather use tables for layouts
RMON
RMONOP12mo ago
Im still tryna figure out rem and em's i keep getting confused
Zoë
Zoë12mo ago
Never made a table website but I did help my dad maintain his table website, it was pretty cool
RMON
RMONOP12mo ago
all I recall is that one is used for the parent and one is for the root, something along the lines of it
ἔρως
ἔρως12mo ago
rem: relative to the root element - <html> em: relative to the parent
Zoë
Zoë12mo ago
https://web.archive.org/web/20190831062920/http://fwgs.eu/ He accidentally replaced one of button images and didn't have a backup
ἔρως
ἔρως12mo ago
however, em has the problem of compoundong, so, it screws all over if you arent careful
RMON
RMONOP12mo ago
Mhmmmm
ἔρως
ἔρως12mo ago
remember the layout challenge? i was the one who made it with table
Zoë
Zoë12mo ago
Nested fonts rather than just </font> to go back to black
No description
Zoë
Zoë12mo ago
Oh yes
ἔρως
ἔρως12mo ago
yikes! papyrus and marquee with images its probably to fight an ie bug
RMON
RMONOP12mo ago
Quick question, As you guys see when I highlight over this it highlights to far up
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
What would be causing this?
ἔρως
ἔρως12mo ago
line height or margin
RMON
RMONOP12mo ago
mhm
Zoë
Zoë12mo ago
My dad wrote the HTML manually when updating everything and I think he didn't know, and I didn't think to look
ἔρως
ἔρως12mo ago
did he use spacer images as well? those are still top shelf high tech for emails 🤮
Zoë
Zoë12mo ago
Yes!
ἔρως
ἔρως12mo ago
i saw the gif bullet point 🤣
Zoë
Zoë12mo ago
No description
ἔρως
ἔρως12mo ago
wow, dreamweaver
Zoë
Zoë12mo ago
My oldest brother made this site in 2004 and I see why he gave up on web development
ἔρως
ἔρως12mo ago
it was awful back then very awful
RMON
RMONOP12mo ago
so it did end up being line hight what would be the correct way to do it?
ἔρως
ἔρως12mo ago
well, it depends
RMON
RMONOP12mo ago
on?
ἔρως
ἔρως12mo ago
how big the clicking area is
RMON
RMONOP12mo ago
Perfect in my opinion you can only click on the text cant click if you're not on the text
ἔρως
ἔρως12mo ago
well, then you can align the items vertically and horizontally with flexbox i cant remember the names of everything, but i press f12 then click on the symbol next to display: flexbox and it lets me click on what i want its easier than remembering all combinations of self, items and justify, align and stuff
RMON
RMONOP12mo ago
im tryna figure this out lol im messing it up
ἔρως
ἔρως12mo ago
i mess up a lot too, so, its fine
RMON
RMONOP12mo ago
where should I add the flexbox display since I alreayd have one in my nav ul? would nav ul li a work? since its the text thats being affected
ἔρως
ἔρως12mo ago
you already have where you should have
RMON
RMONOP12mo ago
It's because after removing line-height it looks likes this
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
goes back to the top obviously
ἔρως
ἔρως12mo ago
however, you can use display: grid on the nav and set the grid-template-columns to 1fr auto this way, the logo is on the left, and the menu on the right then you can align everything on the center the nav will have the same height as the tallest element unless you set one manually, which you shouldnt
RMON
RMONOP12mo ago
alright ima try and figure out how to do all that I havent really used grid much nav ul { list-style: none; display: flex; justify-content: flex-end; margin-right: 30px; gap: 35px; } nav ul li { display: inline-block; } nav ul li a { color: var(--main-text); text-decoration: none; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 1rem; } This is what the code currently looks like for it
ἔρως
ἔρως12mo ago
why do you have all that font stuff on the link? by the way, add an :hover that sets the text decoration to underline, for those items
RMON
RMONOP12mo ago
I thought it would be targeting the last thing in it "a"?
ἔρως
ἔρως12mo ago
it does, but why do you need it?
RMON
RMONOP12mo ago
I was thinking of some design but I'll probably be stealing that idea
ἔρως
ἔρως12mo ago
that is the easiest way, in my opinion
RMON
RMONOP12mo ago
to make the "a" look better
ἔρως
ἔρως12mo ago
oh, and use it on focus too
RMON
RMONOP12mo ago
did I go about it wrong
ἔρως
ἔρως12mo ago
isnt that the same font size and font family as the body?
RMON
RMONOP12mo ago
oh I shoulda added that into the header rather then that im stupid No, I'm thinking of using a different font for the other text in the main section
ἔρως
ἔρως12mo ago
then do this: set the font stuff on the nav, but leave the font-weight for the li a
RMON
RMONOP12mo ago
just did that as you were telling me
ἔρως
ἔρως12mo ago
nice also, remove the font size
RMON
RMONOP12mo ago
Alright
ἔρως
ἔρως12mo ago
unless you are setting a different size on the body
RMON
RMONOP12mo ago
wait so the nav ul li a should only have the font-weight? shouldnt it also have text-decoration and color?
ἔρως
ἔρως12mo ago
color, text decoration and font weight for the a however
RMON
RMONOP12mo ago
also regarding the display: grid I think I mightve done it incorrectly
ἔρως
ἔρως12mo ago
i would add this to the top of your css file:
a {
color: inherit;
}
a {
color: inherit;
}
why?
RMON
RMONOP12mo ago
I think I did it wrong To make sure, Where would I put the display: grid?
ἔρως
ἔρως12mo ago
nav
RMON
RMONOP12mo ago
with this correct? grid-template-columns: 1fr auto;
ἔρως
ἔρως12mo ago
the name of the property might be incorrect, but the value is correct
RMON
RMONOP12mo ago
I dont think it is? wait so after putting these two do I need to add anything else?
ἔρως
ἔρως12mo ago
google it yes, you then need to center everything
RMON
RMONOP12mo ago
justify-content: center right?
ἔρως
ἔρως12mo ago
i think so can you take a screenshot of the thingy i told about before, in the chrome tools?
RMON
RMONOP12mo ago
Let me see what you said about it
ἔρως
ἔρως12mo ago
alright
RMON
RMONOP12mo ago
Ok so you said you would hit f12 (In my case didn't do anything) and then clic on the symbol next to display: flexbox
ἔρως
ἔρως12mo ago
f12 should open the developer tools
RMON
RMONOP12mo ago
not in my case most likely because im using a different browser
ἔρως
ἔρως12mo ago
it works in chrome, ie and ege and firefox
RMON
RMONOP12mo ago
not usin any of those
ἔρως
ἔρως12mo ago
opera?
RMON
RMONOP12mo ago
mhm Honestly, I feel like I should just get rid of it
ἔρως
ἔρως12mo ago
try to right-click and then inspect
clevermissfox
clevermissfox12mo ago
You can also right click and inspect Yeah
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
expand the right column but that is it
RMON
RMONOP12mo ago
No description
clevermissfox
clevermissfox12mo ago
The element you have declared display: flex or display: grid on will have a little button that says flex or grid next to it. Then in the styles , you’ll see your selector and styles
ἔρως
ἔρως12mo ago
yup
clevermissfox
clevermissfox12mo ago
If you find your nav in there
RMON
RMONOP12mo ago
No description
clevermissfox
clevermissfox12mo ago
It will have a little icon next to the “display” if its flex or grid. Click the icon and it will pull up all the alignment props
RMON
RMONOP12mo ago
oh I think I found it
clevermissfox
clevermissfox12mo ago
Yay
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
click the symbol next to flex and or grid
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
click on the first align-content and align-items
clevermissfox
clevermissfox12mo ago
Just know you’ll have to put those properties in your stylesheet. Changing them in the inspector doesn’t push them to your styles so either copy them into your sheet or remember the properties and values and type them in
ἔρως
ἔρως12mo ago
yes, remember what he said
RMON
RMONOP12mo ago
thats true
clevermissfox
clevermissfox12mo ago
Align-content doesn’t do anything on flex if you don’t have flex wrap on
ἔρως
ἔρως12mo ago
should be on by default i think
clevermissfox
clevermissfox12mo ago
In the screenshot it’s not
ἔρως
ἔρως12mo ago
you're right
RMON
RMONOP12mo ago
I assume I add " flex-wrap: wrap;" into my nav?
clevermissfox
clevermissfox12mo ago
You don’t have to But if you want align-content to work that’s just a tip. It’s not always needed but align-items usually is unless you want the default behaviour of stretch
RMON
RMONOP12mo ago
my main goal rn is to have the text a lil lower onto that green line
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
did you add the logo?
RMON
RMONOP12mo ago
Not yet im still thinkin of one apart from the one I created
clevermissfox
clevermissfox12mo ago
You need some padding on your nav
ἔρως
ἔρως12mo ago
add the logo
RMON
RMONOP12mo ago
for now I'll probably just make a <h1>AM</h1> that's Italicized
ἔρως
ἔρως12mo ago
thats not big enough
RMON
RMONOP12mo ago
hmm alright
clevermissfox
clevermissfox12mo ago
Are you wanting them to add something in just to demonstrate how flex works or ?
ἔρως
ἔρως12mo ago
no, im asking it so when he sets the template columns for the display grid, the menu doesnt take the first space and the height of the logo is important, to align the menu horizontally that is, im assuming the logo will be added inside the nav
RMON
RMONOP12mo ago
Im gonna reask this, but the logo doesn't require a specific placement in HTML does it?
clevermissfox
clevermissfox12mo ago
When you put in in a symbol ?
ἔρως
ἔρως12mo ago
just add some placeholder image
clevermissfox
clevermissfox12mo ago
No , I usually put at the bottom So it’s out of the way
ἔρως
ἔρως12mo ago
if you put in a symbol, put at the bottom of the <body> before the script
clevermissfox
clevermissfox12mo ago
Right before the closing </body> tag And yes before script if it’s there
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
That's fine right?
ἔρως
ἔρως12mo ago
yes, because the script will block the rendering
RMON
RMONOP12mo ago
or did I misunderstand
ἔρως
ἔρως12mo ago
no, you have to change that to be a symbol also, you have a copy paste problem
RMON
RMONOP12mo ago
how come?
ἔρως
ἔρως12mo ago
your defs is missing the <
RMON
RMONOP12mo ago
how would I go about doing that?
ἔρως
ἔρως12mo ago
the svg with the weird styles i told you about before this the viewbox, width and height should be copied to the symbol
RMON
RMONOP12mo ago
does it matter where on the doc it is? Ik you said "somewhere' but just makin sure
ἔρως
ἔρως12mo ago
yes: it is supposed to partially replace the svg you pasted
RMON
RMONOP12mo ago
alright
ἔρως
ἔρως12mo ago
in the end, you should have an svg element with a symbol element that has all the contents of that svg
RMON
RMONOP12mo ago
Ok im definetly messin this up gimmie one sec
ἔρως
ἔρως12mo ago
take your time
RMON
RMONOP12mo ago
sorry.
ἔρως
ἔρως12mo ago
its fine you need to break eggs to make an omelette
RMON
RMONOP12mo ago
Ok to make sure, I would get the thing you spoke about and paste the SVG where you commented correct?
ἔρως
ἔρως12mo ago
not the svg
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
but what is inside of the svg with the icon
RMON
RMONOP12mo ago
Thats prolly what I did wrong then
ἔρως
ἔρως12mo ago
you did almost correct
RMON
RMONOP12mo ago
what did I screw up?
ἔρως
ἔρως12mo ago
you see the viewbox?
RMON
RMONOP12mo ago
yea
ἔρως
ἔρως12mo ago
the line that is white?
RMON
RMONOP12mo ago
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 229 204"> ^?
ἔρως
ἔρως12mo ago
yes take the viewbox, then delete the rest
RMON
RMONOP12mo ago
copy and paste that entire thing where the "..." is? viewBox="0 0 229 204" this part to make sure?
ἔρως
ἔρως12mo ago
no, just what is inside the viewbox attribute yes this needs to go on the line above
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
yup
RMON
RMONOP12mo ago
and to make sure when you say "delete everything" as in only leave the symbol or?
ἔρως
ἔρως12mo ago
as in, delete what is left of the white line that is the xmlns
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
perfect, but unindent the </svg>
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
👍 ?
ἔρως
ἔρως12mo ago
that is worse 🤣
RMON
RMONOP12mo ago
what Lmfao
ἔρως
ἔρως12mo ago
it was just to remove the spaces before the closing svg
RMON
RMONOP12mo ago
im sorry im so tired lol
ἔρως
ἔρως12mo ago
same, its 6am
RMON
RMONOP12mo ago
literally got back from school and started learnin code ok why are you awake at 6 am helpin a random stranger with code 🤣
ἔρως
ἔρως12mo ago
cant sleep
RMON
RMONOP12mo ago
we all get those days
ἔρως
ἔρως12mo ago
i fell asleep on my comfy chair, and couldnt sleep anymore
RMON
RMONOP12mo ago
been there done that
ἔρως
ἔρως12mo ago
now, to using the icon
RMON
RMONOP12mo ago
yea you said to unindent the </svg> and I failed at it
ἔρως
ἔρως12mo ago
its fine i failed at lost of stuff anyways
RMON
RMONOP12mo ago
I thought to unident would mean brining it closer to the thing above it?
ἔρως
ἔρως12mo ago
no, thats just commiting a crime
RMON
RMONOP12mo ago
Lol wait so how would i go at it
ἔρως
ἔρως12mo ago
when you indent, you move the code to the right simple
RMON
RMONOP12mo ago
ohhhh omg i mixed indent up with something else
ἔρως
ἔρως12mo ago
now, you need to just use the svg symbol
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
this is fine right
ἔρως
ἔρως12mo ago
yes
RMON
RMONOP12mo ago
ok yea I totally mixed up indent with somethign else
ἔρως
ἔρως12mo ago
thats fine
RMON
RMONOP12mo ago
but yea time to actually use the img because all this work wasnt enough..
ἔρως
ἔρως12mo ago
now, it will get a bit complicated
RMON
RMONOP12mo ago
yay!.. because we need complicated wahoo
ἔρως
ἔρως12mo ago
now, you see the numbers in the viewbox? the ones that arent 0?
RMON
RMONOP12mo ago
mhm 229 204
ἔρως
ἔρως12mo ago
divide 229 by 204
RMON
RMONOP12mo ago
alright let me go grab some paper im just kiddin The answer is 1.12254901961
ἔρως
ἔρως12mo ago
dude, paper??? just use an abacus!
RMON
RMONOP12mo ago
😂
ἔρως
ἔρως12mo ago
multiply that by the height that you want for the logo
RMON
RMONOP12mo ago
alright so like how would I figure out a good heihgt
ἔρως
ἔρως12mo ago
42px?
RMON
RMONOP12mo ago
that's fine I put my logo in your hands 👍 Not to big but big enough so someone can see it and totally offer me a job off the logo alone 🙂
ἔρως
ἔρως12mo ago
now, calculate this: (229/204)*42
RMON
RMONOP12mo ago
I'll never escape math
ἔρως
ἔρως12mo ago
no, you wont
RMON
RMONOP12mo ago
there was a day that I thought I could escape it but no I picked the job that requires math Answer: 47.14705882
ἔρως
ἔρως12mo ago
its a tiny bit
RMON
RMONOP12mo ago
Yk, when I hit college I was thinking of becoming a software engineer but like yk Math..
ἔρως
ἔρως12mo ago
okay, so, create an svg element inside the nav
RMON
RMONOP12mo ago
mhmm
ἔρως
ἔρως12mo ago
then add the width attribute with 42, and the height attribute with 47
RMON
RMONOP12mo ago
alright so funny thing.. yea I have no idea how to do this 😭 like as in literally just
ἔρως
ἔρως12mo ago
its just <svg width="47" height="42">
RMON
RMONOP12mo ago
width=42 ok im overthinking nice
ἔρως
ἔρως12mo ago
with double quotes
RMON
RMONOP12mo ago
my brain is not braining rn
ἔρως
ἔρως12mo ago
i know the feeling
RMON
RMONOP12mo ago
<svg width="47" height="42"></svg> ^ pretty much that right?
ἔρως
ἔρως12mo ago
yes now, inside it, add <use href="#logo"/>
RMON
RMONOP12mo ago
mhmmm
ἔρως
ἔρως12mo ago
that should do it
RMON
RMONOP12mo ago
its there!! but I gotta make it bigger so thats the issue alr let me make it abit bigger
ἔρως
ἔρως12mo ago
calculate that, but instead of 42, use 64, for example or 56
RMON
RMONOP12mo ago
couldnt I just change it by this? <svg width="47" height="42"></svg>
ἔρως
ἔρως12mo ago
depending on which one you might like
RMON
RMONOP12mo ago
I totally already didnt do that and it worked.
ἔρως
ἔρως12mo ago
the problem is the width
RMON
RMONOP12mo ago
no yea tho I did do that and it wokred
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
then set the attributes to the values in there width of 87, height of 72
RMON
RMONOP12mo ago
one sec
ἔρως
ἔρως12mo ago
all of this work has a good reason: you can add the logo as many times as you want, by copy-pasting that svg and also, if you change it in the future, you change in a single place and affects everything
RMON
RMONOP12mo ago
I getchu Real quick, If you don't mind me asking do you have a job as a Front-End Developer
ἔρως
ἔρως12mo ago
i have a job as full-stack
RMON
RMONOP12mo ago
As a full-stack what are you doing in your job?
ἔρως
ἔρως12mo ago
front-end, back-end, database and all the fun behind
RMON
RMONOP12mo ago
In my case, I'm currently learning front-end would you recommend me going into it? (Self-taught) with the current market situation being crazy
ἔρως
ἔρως12mo ago
i recommend a certain degree of full-stack, so you are capable of taking on both, which makes you a lot more marketable but focus on front end now backend cant do much without a front-end
RMON
RMONOP12mo ago
I was thinking about a cs degree but the traditional way they have that setup basically makes/trains you to be a software engineer and im mostly into web developments maybe backend/full stack you think i should stick to self teaching and just work my ass off for a job? and you are 100% right
ἔρως
ἔρως12mo ago
do you think their classes will be helpful?
RMON
RMONOP12mo ago
the classes are like calc 1-2 and like physics/engineering stuff like that and from my knowledge no way you need that for web dev lol i wish they had a web dev degree 😭
ἔρως
ἔρως12mo ago
true, you kinda dont but learning that may be helpful for you to appreciate how the pc works but honestly, i would try to improve your front end skills first, then work on backend but honestly, the way things are, i dont know if a computer science degree helps i was lucky as hell to get in right when the market went bust
RMON
RMONOP12mo ago
this is exactly what i was thinking but i was just scared i would not be able to get a job or i guess compete in the market ooooh lucky ass
ἔρως
ἔρως12mo ago
you would very lucky
RMON
RMONOP12mo ago
i can barely find front end dev positions xD
ἔρως
ἔρως12mo ago
i got a new job and a few months later the layoffs started at big companies
RMON
RMONOP12mo ago
thats the one thing I've been hearing
ἔρως
ἔρως12mo ago
front-end is too small of a scope, in my opinion tipping your toes with backend is important too
RMON
RMONOP12mo ago
How would you recommend me going about it?
ἔρως
ἔρως12mo ago
if you can, learn both
RMON
RMONOP12mo ago
Because eventually I do plan on going into backend, I was thinking of the fact people do target Front-End as a coding career which would mean more competition to deal with
ἔρως
ἔρως12mo ago
i am lucky because i can apply to anything frontend and backend thats why im fullstack but, now, lets focus on making your stuff work
RMON
RMONOP12mo ago
you're right, thanks again!
ἔρως
ἔρως12mo ago
did you add display grid to the nav?
RMON
RMONOP12mo ago
I added this display: grid; grid-template-columns: 1fr auto; Also to align it correctly like how I wanted couldnt I use padding?
ἔρως
ἔρως12mo ago
show me this, for the display grid if you are a barbarian, yes
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
align-items: click the first one
RMON
RMONOP12mo ago
ok sooo it didnt do anythin
ἔρως
ἔρως12mo ago
that should work
RMON
RMONOP12mo ago
most likely means i have somethin screwin with it
ἔρως
ἔρως12mo ago
add margin 0 and padding 0 to the ul
RMON
RMONOP12mo ago
wait you did it!
ἔρως
ἔρως12mo ago
what was the problem?
RMON
RMONOP12mo ago
The website wasn't registering the change
ἔρως
ἔρως12mo ago
weird but happens now, the menu should always be aligned based on the height of the logo BUT we arent done what's the padding around the nav?
RMON
RMONOP12mo ago
currently 15px 25px
ἔρως
ἔρως12mo ago
yes add a gap of 25px to the nav
RMON
RMONOP12mo ago
done
ἔρως
ἔρως12mo ago
thats it, you have a menu and logo working in under 3 hours
RMON
RMONOP12mo ago
a whole 3 hours 😭
ἔρως
ἔρως12mo ago
by the way, on the a add this: outline-color: currentColor
RMON
RMONOP12mo ago
didnt change much?
ἔρως
ἔρως12mo ago
what it does is to set the color of the outline for the menu, when it is focused
RMON
RMONOP12mo ago
oh I see
ἔρως
ἔρως12mo ago
so, press tab on the page and it should have white all around the link try it
RMON
RMONOP12mo ago
alr oh wth thats sick
ἔρως
ἔρως12mo ago
originally, it is blue but doing that, changes to the same color as the text in the future, if you add a light theme, then you dont need to think about it or, if you change the color too
RMON
RMONOP12mo ago
i see Do you think this is fine? With the tint of blue?
ἔρως
ἔρως12mo ago
by the way, try duplicating an li a bunch of times?
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
i like it
RMON
RMONOP12mo ago
alright cool
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
There's the spam
ἔρως
ἔρως12mo ago
more times
RMON
RMONOP12mo ago
9 times but sure
ἔρως
ἔρως12mo ago
more
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
yikes! add a flex-wrap: wrap to the nav ul
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
perfect
RMON
RMONOP12mo ago
I see, pushes it down rather then forcing it
ἔρως
ἔρως12mo ago
yup
RMON
RMONOP12mo ago
yea one thing ive realized as ive coded is i'd find "fixes" to the problems I had but in reality theres the real correct way I woulda remvoed line height popped a padding and called it a day like a savage
ἔρως
ἔρως12mo ago
its not "correct" way its the "much better" way
RMON
RMONOP12mo ago
obviously
ἔρως
ἔρως12mo ago
for example, the menu could have been a grid, but it is a bit harder to do the wrapping and the nav could be a flexbox, but its harder to keep items at specific sizes or you could use floats and suffer for years
RMON
RMONOP12mo ago
yea, learned that the hard way another quick question, when it comes to making text clickable why is that sometimes I can click the text without hovering over it?
ἔρως
ἔρως12mo ago
in 2030, doing this with a flexbox might be a bad practice and it could be better to use sub-grids with something else line height
RMON
RMONOP12mo ago
oh I see
ἔρως
ἔρως12mo ago
it basically reserves that space for the text also, margins can do that too i mean, paddings, sorry and depending on the styles and html you have, you may be clicking on the a but not be applying any styles to, say, a span inside of it
RMON
RMONOP12mo ago
I see what youre saying
ἔρως
ἔρως12mo ago
but usually its line height, padding or bad code
RMON
RMONOP12mo ago
Ive realized sometimes it was the <a> as I'd go into inspect element and see ther there*
ἔρως
ἔρως12mo ago
yup, and with floats, it can be that the parent simply has no height and the browser just doesnt know what to do and sets everything to weird sizes
RMON
RMONOP12mo ago
Alright, I just wanna say again thank you so much for all your help and yk stayin awake since 6 am you've literally made this so much easier for me but im gonna have to hop off for the night since I got school in the morning.
ἔρως
ἔρως12mo ago
you're welcome
RMON
RMONOP12mo ago
I hope one day I can reach your level because it's outstanding you litearlly have an answer to every question and it works perfectly with no mistakes
ἔρως
ἔρως12mo ago
https://discord.com/channels/436251713830125568/824795596283576370/1192361497838493756 thats because ive made the mistakes before you just need to practice and it will all come to you, with time
ἔρως
ἔρως12mo ago
you will learn, with practice
Zoë
Zoë12mo ago
Chris Coyier
CSS-Tricks
A Complete Guide to Flexbox | CSS-Tricks
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.
Chris House
CSS-Tricks
A Complete Guide to CSS Grid | CSS-Tricks
Our comprehensive guide to CSS grid, focusing on all the settings both for the grid parent container and the grid child elements.
ἔρως
ἔρως12mo ago
grid and flexbox make sense
RMON
RMONOP12mo ago
Quick question, So since Im meant to suffer with the small space and design the next section and let the page change size by it's self
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
How am I meant to start coding in that tiny black line
Zoë
Zoë12mo ago
Put things in it, it'll expand, assuming that height hasn't been set
RMON
RMONOP12mo ago
no set hiehgt apart from the footer height: 10rem the rest has no height
Zoë
Zoë12mo ago
Then yeah just put content in the black part and it'll expand
RMON
RMONOP12mo ago
alright then
Zoë
Zoë12mo ago
Padding is the way to add bulk around the content
RMON
RMONOP12mo ago
ok I have a quick question so I wanna have text that goes in the middle of the screen and only a little bit down how can I go about that correctly? and of course still have it be responsive could I just center it normally and add a margin?
Zoë
Zoë12mo ago
I would go with grid because it's easier to then force stuff to not be too wide
RMON
RMONOP12mo ago
If you need an example something like this
RMON
RMONOP12mo ago
No description
Zoë
Zoë12mo ago
Ah, that you can use flexbox with. on the section you'll want something like
section {
display: flex;
flex-direction: column;
align-items: center;
padding: 4rem;
}
section {
display: flex;
flex-direction: column;
align-items: center;
padding: 4rem;
}
V this is HTML but in an easier to type format
section
h2 About
h3 Personal Info
p Whatever that small text says
section
h2 About
h3 Personal Info
p Whatever that small text says
RMON
RMONOP12mo ago
Would I make one container that centers everything and spaces things away then add a <h6> that states "About" then add an <h1> for "personal Info" and a <p> for "Get to know more about me"? I have the layout I want but It wouldn't be right to center the entire section as there will be more under that isn't meant to be center so could I make a contianer inside the section? Ok another question, How do you guys add that box around the code? wait how come Personal info is less important then About?
Zoë
Zoë12mo ago
#how-to-ask-good-questions There's more to About than Personal Info
RMON
RMONOP12mo ago
I would have assumed "personal info" would've been more important as it tells the user that's where you find the "personal info" and "about" just tells the user that it's an about section
Zoë
Zoë12mo ago
It makes more sense if you've ever written Markdown documents, the heading trees explain why
RMON
RMONOP12mo ago
Sadly I haven't written Markdown Doc's but I'll figure the way headings actually work
Zoë
Zoë12mo ago
If you have
section
h3 About
h2 Personal Info
p Whatever that small text says
section
h3 About
h2 Personal Info
p Whatever that small text says
That h3 has nothing to do with the h2 now, it's entirely unrelated You could do
section
h2 Personal Info
h3 About //then using CSS move this above
p Whatever that small text says
section
h2 Personal Info
h3 About //then using CSS move this above
p Whatever that small text says
I do have an example of shifting things around so they make sense heading wise https://codepen.io/z-/pen/ExGEwBK?editors=1100 visually the h2 is below the h3 of the author but in the HTML the h2 is above h3 However I think that it should be About > Personal Info, and the size of text isn't a factor
RMON
RMONOP12mo ago
<section class="About-Me">
<div class="ABOUT">
<h2>ABOUT</h2>
<h3>Personal Info</h3>
<p>Get to know more about me</p>
</div>
</section>
<section class="About-Me">
<div class="ABOUT">
<h2>ABOUT</h2>
<h3>Personal Info</h3>
<p>Get to know more about me</p>
</div>
</section>
I have that currently, It isn't done for the entire section but for the top part it's pretty much about that
Zoë
Zoë12mo ago
Looks good
RMON
RMONOP12mo ago
Ok another question, I want to change the color of my <h2> would it be better to create a span for it
Zoë
Zoë12mo ago
Just select the h2
RMON
RMONOP12mo ago
How about if I do plan on using h2 again?
Zoë
Zoë12mo ago
You can
RMON
RMONOP12mo ago
wouldn't span just be better to avoid the issue?
Zoë
Zoë12mo ago
No, because that doesn't follow the rules of semantic HTML
RMON
RMONOP12mo ago
So how would someone do it correctly to follow the rules of semantic HTML?
Zoë
Zoë12mo ago
With there being a h2, if someone goes to your website "Get to know more about me" is under the headings Page > About > Personal Info They're complicated and I don't know of any resources for it
RMON
RMONOP12mo ago
Alright I getchu ty Also, If I wanna make a navbar that appears when I scroll down the second part of my page what could I do for that? would it have to be JS or can I do it in HTML and CSS?
Zoë
Zoë12mo ago
Depends on what exactly you're after
ἔρως
ἔρως12mo ago
don't set an height on the footer: just set a padding top and bottom
RMON
RMONOP12mo ago
for example in the screenshot you can see the Navbar
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
When I scroll down I'd like it to appear the same just with a background of black till I can scroll all the way back up again will do what sizes would be good for the footer?
Zoë
Zoë12mo ago
Like position: sticky; top: 0;? I'm not quite getting what you're after
ἔρως
ἔρως12mo ago
he wants the background to start transparent, and by scrolling, it transitions to fully opaque, but another color
RMON
RMONOP12mo ago
I dont really know how to explain it, My main goal is to have the Navbar stay the same when Im at the landing page and when I scroll down the Navbar continues to show when I scroll it becomes black and once I get back to the landing page it's transparent again
Zoë
Zoë12mo ago
Ohhh, you can use a fixed gradient background-image, although the header won't be perfectly the same colour while transitioning, but you could have it gradual enough that it almost is
RMON
RMONOP12mo ago
honestly, as long as it becomes full black before I hit the second section It'll be perfectly fine also, Regarding the padding of 4rem you added wouldn't it be better to just have a padding top rather then it surrounding everything? Im only asking as it looks like it's takin all the sapce
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
I'll also be adding things further down in the white page but wouldn't the padding interfer with anything?
Zoë
Zoë12mo ago
The other stuff would be within that padding. This is the About section
Zoë
Zoë12mo ago
I had this backwards, this works but only for something that moves with the page. Alternative is to change the stacking context to place the header background under the section so that when you scroll past you keep the background but the background isn't there for the section. Or just always have the background. Or in the future use this https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_scroll-driven_animations (just be aware there's 0% support without enabling it with flags https://caniuse.com/?search=scroll%20driven%20animations, so you can't use it now, but you can play around with it in Chrome)
MDN Web Docs
CSS scroll-driven animations - CSS: Cascading Style Sheets | MDN
The CSS scroll-driven animations module provides functionality that builds on top of the CSS animations module and Web Animations API. It allows you to animate property values based on a progression along a scroll-based timeline instead of the default time-based document timeline. This means that you can animate an element by scrolling a scrolla...
Zoë
Zoë12mo ago
(I need to sleep, exhausted)
RMON
RMONOP12mo ago
Good night, Thank you for all the help! @ἔρως would there be any other ways to approach this?
Zoë
Zoë12mo ago
Or just use some JavaScript
ἔρως
ἔρως12mo ago
i think you can just use an animation with scroll like how kevin did in his recent videos
Zoë
Zoë12mo ago
0% support currently
RMON
RMONOP12mo ago
Sadly I dont know any JS And I dont really wanna just steal the code without knowing what any of it is
ἔρως
ἔρως12mo ago
honestly? don't over-complicate just make it look good first, without any fancy bullshit
RMON
RMONOP12mo ago
the only fancy thing I wanted was that I could scroll and the navbar would go with it with the original nav staying at the top in the landing page also to just make it easier to use to go back and forth using buttons
ἔρως
ἔρως12mo ago
you mean, the navbar being sticky at the top?
RMON
RMONOP12mo ago
mhm
Zoë
Zoë12mo ago
You want this
RMON
RMONOP12mo ago
Alrighty then, appreciate it! Would I add that to my Nav? Oh never mind figured it out lmao I added it to my header and it worked 😂
ἔρως
ἔρως12mo ago
it's a bit easier than it looks like
RMON
RMONOP12mo ago
Just overthinking it honestly Im gonna try to figure somethin our rq in my landing-page and if I cant ill be back
ἔρως
ἔρως12mo ago
alright
RMON
RMONOP12mo ago
Excuse my terrible drawing skills of an arrow and box
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
But how would I move that text correctly inside that green box? I was thinking of margins but Im not 100% sure
ἔρως
ἔρως12mo ago
move the text?
RMON
RMONOP12mo ago
The three lines of text Hello There I am Arman Markaryan I am a Front-End Developer
ἔρως
ἔρως12mo ago
you want it to go to that box?
RMON
RMONOP12mo ago
Mhm And I'll style it ofc but just gotta figure out how to move it correctly I was gonna do margins or something like position: absolute; but would it still make the page responsive If I shrink the page?
ἔρως
ἔρως12mo ago
honestly, this is something im not that amazing at, but i would use a grid
RMON
RMONOP12mo ago
For example the picture im goin off is this
RMON
RMONOP12mo ago
No description
ἔρως
ἔρως12mo ago
yeah, i would do it with a grid, or flexbox
RMON
RMONOP12mo ago
I tried doin center and that but ofc I dont want it exactly centered
ἔρως
ἔρως12mo ago
but i can't explain it properly, because i suck at making those
RMON
RMONOP12mo ago
it's like centered but a lil to the left I getchu, I'll try to figure it out but If I were to use positioning would it screw up the responsiveness? as in when I shrink the page
ἔρως
ἔρως12mo ago
it would screw up everything if you use a position absolute
RMON
RMONOP12mo ago
relative? it wont right
ἔρως
ἔρως12mo ago
it shouldn't, but you won't have any fun working on it
RMON
RMONOP12mo ago
How come? Seems somewhat simple to use
ἔρως
ἔρως12mo ago
it will bite you in the ass, when you try to make it responsive
RMON
RMONOP12mo ago
mhmm I see
ἔρως
ἔρως12mo ago
what you can do is to have a div inside the section, and the section takes 100dvh of minimum height, or something like that
RMON
RMONOP12mo ago
I watched a quick clip of this one guy doin it and he used margins for it
ἔρως
ἔρως12mo ago
that gets messy super fast
RMON
RMONOP12mo ago
how come?
ἔρως
ἔρως12mo ago
you will have to fix margins all over the place
RMON
RMONOP12mo ago
I assume it screws with responsiveness too?
ἔρως
ἔρως12mo ago
yes
RMON
RMONOP12mo ago
Quick question, I wanna add a little design where it's literally just a thin line next to my text would I just do that with a height, width and coloring?
ἔρως
ἔρως12mo ago
you can use a border
ἔρως
ἔρως12mo ago
https://jsfiddle.net/agLy86t3/ <-- this is something pretty shitty that i made just to get your gears going
Edit fiddle - JSFiddle - Code Playground
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
ἔρως
ἔρως12mo ago
with some media queries or container queries, you can make this a lot better
RMON
RMONOP12mo ago
alright ty
ἔρως
ἔρως12mo ago
but keep in mind: THIS IS VERY SHITTY CODE
RMON
RMONOP12mo ago
also regarding the line I literally meant like a literal line --- Hello there Instead of dotted line a single line yk
ἔρως
ἔρως12mo ago
oh, you can use a ::before with a border, or an <hr>
RMON
RMONOP12mo ago
alright I tried doing ::before right now the only issue is it's not next to my line and I'd have to use positioning with it
.Hello-There::before{
content: '';
display: block;
width: 3em;
min-height: 2px;
background-color: #fff;
position: absolute;
left: 10rem;
}
.Hello-There::before{
content: '';
display: block;
width: 3em;
min-height: 2px;
background-color: #fff;
position: absolute;
left: 10rem;
}
ἔρως
ἔρως12mo ago
how about a bunch of em dashes? or box building characters
RMON
RMONOP12mo ago
I wouldn't even know how to do that correctly
ἔρως
ἔρως12mo ago
━━━━━━━━ like this ━━━━━━━━━ it's not perfect for all fonts but it's a shitty solution im sure there's something a lot better if you show exactly what you want, that might be easier
RMON
RMONOP12mo ago
The issue is the reference im goin off is shitty quality
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
Like pretty shitty, if you look to the left of "Hello There" You can see a line in my case
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
I gotta have the white line (color change possible) to be in the start of the container with the "hello there" text shifted to the right
ἔρως
ἔρως12mo ago
https://jsfiddle.net/nwtfLskr/ <-- here's some shitty code to get your noodle working while i 😴 💤
Edit fiddle - JSFiddle - Code Playground
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
ἔρως
ἔρως12mo ago
it's not aligned or anything, but it works you can use the span and pseudo-elements, and it will work sorta the same
RMON
RMONOP12mo ago
honestly thats pretty good I just need the left side of it Either way thank you!
ἔρως
ἔρως12mo ago
it works pretty well, when it is aligned properly and if the text is too long, it wraps the text
RMON
RMONOP12mo ago
Fire 🔥
ἔρως
ἔρως12mo ago
have fun with it
RMON
RMONOP12mo ago
ty Hear me out
RMON
RMONOP12mo ago
No description
RMON
RMONOP12mo ago
If I fix this this up and keep those two lines it would look fire and center the text
ἔρως
ἔρως12mo ago
yeah, just a text-align: center
RMON
RMONOP12mo ago
Yup wait For some reason it isnt working when I do "text align center" it moves the entire thing to the center
clevermissfox
clevermissfox12mo ago
Make sure it’s min-height or you’ll get overflow at small screens…
RMON
RMONOP12mo ago
ended up getting rid of the height just added a padding I have a question since I have your attention could you assist with this? https://discord.com/channels/436251713830125568/1194858269529878589 I couldn't figure it out
clevermissfox
clevermissfox12mo ago
Oh good that’s the proper way to make your element take up size outside of the content
RMON
RMONOP12mo ago
What padding would you recommend tho? Honestly I didnt give it much
Skylark
Skylark12mo ago
Spend some time just playing around with properties
clevermissfox
clevermissfox12mo ago
At least 1em but depends how much size you want. People tend to be very conservative with white space as a whole , never giving enough margin or padding so aim for a little more than you think it should have I answered
Skylark
Skylark12mo ago
Just look and use what looks nice. If you don’t know what looks nice spend some time really looking at websites. See what is out there Front end developers have got where they are because they experiment and find what looks good. It is difficult starting out but people rave about codepen and jsfiddle for making it easy to try. Browse codepen and make a note of the common properties people use and play with them, edit existing pens
RMON
RMONOP12mo ago
hey @ἔρως - When ever you have free time to help. In the img above if you notice those two buttons I created how can I move them to that empty red box I drew out
No description
Skylark
Skylark12mo ago
Probably not already using grid? Use grid Prefer learning flex box? Put what you half already and the buttons into 2 containers move the vertical flex box properties into the containers and then use a horizontal flex box Grid is better but flexbox can still do exactly what you want
RMON
RMONOP12mo ago
.ButtonContainer {
display: flex;
flex-direction: column;
width: fit-content;
gap: 1rem;
}

.button-like {
padding: 10px 20px;
text-decoration: none;
background-color: transparent;
font-family: Arial, Helvetica, sans-serif;
color: #fff;
border: 2px solid #fff;
}
.ButtonContainer {
display: flex;
flex-direction: column;
width: fit-content;
gap: 1rem;
}

.button-like {
padding: 10px 20px;
text-decoration: none;
background-color: transparent;
font-family: Arial, Helvetica, sans-serif;
color: #fff;
border: 2px solid #fff;
}
That's the code im currently using for it
<div class="ButtonContainer">
<a href="#" class="button-like">Latest Projects</a>
<a href="#" class="button-like">More About Me</a>
</div>
<div class="ButtonContainer">
<a href="#" class="button-like">Latest Projects</a>
<a href="#" class="button-like">More About Me</a>
</div>
Im going to be AFK for about 20 minutes-ish I'll be back, apologies
Want results from more Discord servers?
Add your server