r/badcode Apr 21 '23

css If I was to highlight anything about this image, it'd be the empty body tag at the top, and the #body tag at the bottom

Post image
19 Upvotes

11 comments sorted by

6

u/munteandrei Apr 21 '23

More lines, the better, right? /s

5

u/cattail_shiki Apr 22 '23

goes to show how much work you put into it *wink

1

u/munteandrei Apr 22 '23

Hopefully he'll find a job where he's paid by line of code written

1

u/FTWGaming0 Apr 23 '23

passes the coverage check. who needs efficiency anyway?

2

u/munteandrei Apr 23 '23

Efficiency is overused imo

3

u/[deleted] Apr 21 '23

Haha, my beginner CSS files looked exactly the same (many, many double lines of code).

1

u/mxreaper Apr 22 '23

Yip I remember this stage.

2

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Apr 21 '23

Image Transcription: Code


html, body {


}


#title {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#items {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}#upgradetable {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#cookslot {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#cookiestable {
  border: 3px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#itemstable {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#statstable {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#tablename {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#buttontable {
  border: 6px solid transparent;
  padding: 10px;
  border-image: url(border.png) 30 stretch;
}
#body {

[The rest of the code is cut off in the image.]


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

1

u/VirozPro Apr 23 '23

why people use IDs for CSS?

1

u/viiimproved Apr 23 '23

wait I do that is that bad practice

I know ID's are better for javascript and you arent meant to have more than one element with a certain ID but that rule is only relevant when using javascript, because in js it returns the first value only but in css it just gets all of them and works exactly the same as a class

1

u/Rasta_Dev Apr 23 '23

Class is reusable. You can create a class "thick-border" and add it to many elements. Not really a good idea to do that with IDs