Other than the obvious reason that you need special tags like img or a or input to do things like add images and links and whatever, browsers give some tags special properties and default styles that you can use to design your website so that you need to write less HTML and CSS or JS, and therefore make it much more maintainable. For example, the summary/details tag, or the fieldset tag, or the label tag. All of these have special properties that can improve your UX with minimal effort.
But other than that, if you really want to, you certainly can design a website with only divs.
Let me ask this: if you can give things different names, like main or nav or header or footer or section or article, so you immediately know what they are when you see them and you can separately target them in CSS and DOM without adding classes, and they work just as well as a div... for what reasons would you want to make everything a div instead? Is it somehow easier or less overhead to type the word div instead of footer?
Screenreaders is also a big part, blind people have a tool that reads the website to them, if you don't use any of it they have to sit there and listen to everything you put in the divs.
Making semantic html solves that problem most of the time
Google provides decent, free analytics to web developers so they can see some stuff about the people who visit their site, in exchange for informing Google that you've been to that web page.
The comment is a joke about the website being perfect and clean and simple, but he's nestled in some javascript, which goes against his satirical website.
I know, I'm just wondering what the point of having Google analytics on there would be. But thinking about it more I guess I would be curious about who visits my site
Wouldn’t the default configuration of any web server log all the info you need? Apache httpd logs time stamps, URLs, agent strings and IP addresses - process that log and you can get the info you want. I’m pretty sure all the other web servers do that, too…
Your web host might not give you access to that sort of information
Apache logs don’t give you geographic, demographic, and other such information. They also don’t tell you things like which pages of your site are most popular or how long an individual visitor stays on your site on average.
I mean, it's consistent with the philosophy. The GA code is there because it does something useful, unlike all the other stuff the author was ranting about.
See I'm self taught, and this is how I thought websites were made in the past, I would design literally 99% of the front-end without JS, and then add JS in. To be fair at the time I was an idiot and didn't know things like React exist, also to be fair I don't like React very much but hey.
As much as I loved the humor in all three, they do have good points in regards to web design and optimization and all that. Think of it that you just gotta design taking potential users from 3rd world countries with shit internet infrastructure into consideration.
That website is wrong about contrast. Pure black on pure white is not good for the eyes. It's hard to read. White on black isn't quite so bad, but even changing that to #eeeeee off-white on #111111 off-black improves readability.
In every other respect though that definitely is better. Using gzip and a cert are especially good points.
I really hope you are being sarcastic. If not, well, AMP is just overrated google crap. It's just a bunch of "optimizations" that strip off your trackers and javascript and replaces it with Google's trackers and js. I suppose they just preload the AMP pages to make it look fast. The only reason most people actually use it is because it gives pages a better rank in Google Search, afaik. Disclaimer: I am not 100% sure about any of this, so take this with a pinch of salt.
Well when it's all just text then the only thing you need is a simple declaration to tell your mobile browser to use appropriate scale and you're good to go
Meanwhile my dumb ass was up late last night trying to get SimpleBar to wrap around bootstrapTable without hiding the entire fucking table on me.
The worst part is that the table is in the admin page where only I and my co-admin will ever see it. And the regular scrollbar was working fine. But I refused to lose.
I wish this was perfect, but some accessibility workshops I attended hosted by people who actually require a screen reader might have a couple comments. But it's still better than most of the crap you see online. (by a damn landslide)
Just use display: inline-block on everything to put your whole website into a quantum state of being spans and divs at the same time until it's observed.
I remember when a web designer joined my team back in 2012 or so. He told us we might be able to use divs and spans for laying out websites. We thought it was bullshit.
There are so many more semantically correct tags to use though. Header, footer, main, article, aside, section, nav, etc. Divs are still by far my most-used block level element but I'll use the other options whenever they make sense.
I read the first half and was like, yeah I use all those and still div the fuck out of sites lol. Sections and articles definitely helped cut down a little bit though.
New job is backend though, so that's interesting I guess. As much as I enjoyed the puzzle of getting the damn html and css to cooperate with me, backend is definitely a new and different challenge. More like a game of hide and seek really hahaha
[A drawing of a small grey bird perched on a tree branch. The bird looks happy, with its head slightly cocked.]
Grey Bird: Semantic HTML conveys meaning.
Panel 2:
[The bird is staring forward with a confused expression.]
Grey Bird: This help
Off-screen: [Interrupting]
<div>
Panel 3:
[A large black bird with yellow eyes and a crazed expression is shown, perched on a branch in front of the grey bird. The black bird has a yellow speech bubble, which interrupted the grey bird in the previous panel.]
Black Bird:
<div>
<div>
<div>
<div>
<div>
<div>
Panel 4:
[An up-close image of the grey bird, with an irritated expression on its face. In the background, the black bird continues to speak.]
The center thing meme is just too real for front-end noobs like me, I don't know shit about CSS.
We have some internal apps just for our team, it was bothering me that a certain text wasn't centered (was placed to the left side), so after a quick Google search I used text align, didn't work, attempted other shenanigans, didn't work.
This post was removed by its author using Redact. Possible reasons include privacy, preventing this content from being scraped, or security and opsec considerations.
employ provide entertain payment office detail reach obtainable marble tan
To be fair, sometimes you find out that flex-flow: column wrap; doesn't work on that one browser and you have to switch to flex-flow: row wrap; and shuffle your input array into row order. 🤮
Could you please explain this a bit? If a website is just simple text with the information it wants to convey and some links for sources like wikipedia, does it require tags? I can see that the more clustered a website with ads gets the more useful tags become for extracting the information you want, but does a simple design also require tags in that quantity?
If you're planning on making websites professionally, you should really look into and make every site accessible, one of my first jobs was for a business run by blind people, it changed the way I made websites forever and actually got me a full time job, very highly regarded by big business
Yes, screen readers don't just read the text from a webpage but also give clues of what they are reading.
For example if you use a <nav /> tag or use role="navigation" the screen reader will indicate that it's entering an area meant for navigation.
Also, you can use ARIA labels to make even complex widgets usable with a keyboard and understandable with just a screen reader.
If you build your website in a way that you can navigate between important elements with the tab key, and you move into a tab control the screen reader will read something like
Main navigation tab control, first of six tabs, My Feed, selected
if you're using semantic html and ARIA labels correctly
Having proper semantics let’s browsers know what kind of content it’s dealing with. If this is done, assistive technology will be able to do its job since the website is in a structure it can work with. For example, imagine I was a screen reader user navigating a page and the first thing I land on is the main heading of the page <h1>. What the screen reader would say to me is “heading level one (main header of webpage)”. A very coming way that screen readers use to navigate pages is by navigating headers. By having proper header hierarchy it will allow a screen reader users to differentiate between the main heading, sub headings, and sub sub headings of the page.
Honestly I just glossed over one thing and there’s more to accessibility on the web. One thing I would look into is ARIA if you want to get into accessibility and WCAG.
We're using Reactstrap at work, and it's bizarre knowing that my <Table> element is being transformed into a <div class="Table"> behind the scenes, which then applies a shitload of stuff to...create a table, which HTML natively supported already.
Jfc table? There are very specific rules for nesting things in tables, it's very annoying to do. And nobody cares if shit run on potato, actually it's good that it doesn't work, maintaining website for super old browsers is pain in the ass
I was not talking about entire layout in tables, ofc it was awful. I saw divs used for simple tables like 3x3 with ... hmmm... data from db/excel tables.
Welcome to web builder. Probably someone was smartass and decided to use web builder instead of hiring developer, fucked something up and now needs help.
Honestly semantic HTML is useful if you plan on using VanillaJS and CSS.
Most people that I have met start learning with a JS framework and does all the dynamic loading crap. Not to say that it is bad but there are simple solutions and there is enterprise solutions.
564
u/SegFault137 Sep 02 '21
Literally the next post in my feed is https://www.reddit.com/r/programminghorror/comments/pgi0ql/the_website_i_have_been_tasked_with_updating_today/?utm_medium=android_app&utm_source=share
27
u/TabCompletion Sep 02 '21
Found it here
16
u/Dodgy-Boi Sep 02 '21
<div>
1.4k
u/YourUsualSir Sep 02 '21
https://motherfuckingwebsite.com/
145
u/Perpetual_Doubt Sep 02 '21
<div class="footwrapper">
<!-- <footer> -->
<div id="theFooter">
231
u/glorious_reptile Sep 02 '21
This is a blatant lie. There’s also <span>
60
u/JiminP Sep 03 '21
Does anyone remember the old times when every layouts were done by using
<table>s?116
u/[deleted] Sep 02 '21
I went from abusing divs to abusing sections
195
u/knightttime Sep 02 '21
Image Transcription: Meme
[A four-paneled comic, with a watermark: "FALSEKNEES.COM © 2016"]
Panel 1:
[A drawing of a small grey bird perched on a tree branch. The bird looks happy, with its head slightly cocked.]
Grey Bird: Semantic HTML conveys meaning.
Panel 2:
[The bird is staring forward with a confused expression.]
Grey Bird: This help
Off-screen: [Interrupting]
Panel 3:
[A large black bird with yellow eyes and a crazed expression is shown, perched on a branch in front of the grey bird. The black bird has a yellow speech bubble, which interrupted the grey bird in the previous panel.]
Black Bird:
Panel 4:
[An up-close image of the grey bird, with an irritated expression on its face. In the background, the black bird continues to speak.]
Black Bird:
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
69
u/thygrrr Sep 02 '21 edited Sep 02 '21
This sums up my feelings about web dev.
And the "can you center a div?" meme plays right into that - what in the world became of the <center> HTML element, please?!
52
u/coconuts_and_lime Sep 02 '21
Tbf the button element comes with so much unwanted default css
50
u/sumredditaccount Sep 02 '21
This feels personal and I don't like it
61
u/t-minus-69 Sep 02 '21
RIP blind folk who rely on HTML tags to read page content
29
u/devospice Sep 02 '21
This is why I hate bootstrap. It's programming in the 90s all over again but with divs inside of divs instead of tables inside of tables.
9
u/[deleted] Sep 03 '21
It's funny because it used to be everything was a table, then everyone realized semantic is better so.... they made everything a div :/
6
u/AllesYoF Sep 02 '21
Funny enough, this post is right below the one with 1000 nested divs
6
u/decorona Sep 03 '21
This is one of the best.
4
u/_WindRider Sep 02 '21
pagebuilder be like
3
u/ampersand913 Sep 03 '21
I love how this is mostly true until you start to really get a grip on HTML and you start to realize that not all HTML elements are made equally
3
u/huntforacause Sep 03 '21
Just <svg> and throw all that obsolete shit away…
3
u/tubbana Sep 03 '21
I usually use just div because alternatives force me some shit default styling that I have to figure out and override
2
u/Farfignugen42 Sep 03 '21
Not everyone wishes to convey meaning, apparently.
5
u/Idaret Sep 02 '21
Div is cool because it just works everywhere whic h can't be said about every htnl entity
1
u/bandaids20 Sep 02 '21
Made me lol
1
u/Knuffya Sep 02 '21
The google bot will not take this lightly
1
u/Ry_Guy_OSRS Sep 03 '21
https://github.com/willmartindev/div.js
1
u/lets-talk-graphic Sep 03 '21
But does it confirm to WCAG 2.1 AAA? - I dunno I’m on the app and it’s early. I’ll check later.
1
u/nab_noisave_tnuocca Sep 03 '21
mfw you can't put divs in tables
1
u/Saanvi_Sen Sep 03 '21
1
u/[deleted] Sep 03 '21
I wish I had someone to share this with hahahaah
1
u/WhySoCynicalTho Sep 03 '21
the pigeon is my IT teacher, the crow is me.
1
u/Idaret Sep 03 '21
Grid would be better for that use, I think
1
u/Idaret Sep 03 '21
Grid would be better for that use case, I think
1
u/miss-emenems Sep 03 '21
I'm looking at you Apple 👀 https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css#3667431
1
u/Whitedevil998 Sep 03 '21
Yea semendick
1
u/[deleted] Sep 03 '21
Welcome to web builder. Probably someone was smartass and decided to use web builder instead of hiring developer, fucked something up and now needs help.
1
u/jukuduku Sep 03 '21
Honestly semantic HTML is useful if you plan on using VanillaJS and CSS.
Most people that I have met start learning with a JS framework and does all the dynamic loading crap. Not to say that it is bad but there are simple solutions and there is enterprise solutions.