CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: HTML & CSS seems messy and all over place, can you help...  (Read 295 times)

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
CodePen

Can the HTML/CSS be improved/and or optimised?
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 1060
  • Karma: +188/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: HTML & CSS seems messy and all over place, can you help...
« Reply #1 on: 12 Mar 2023, 04:59:06 pm »
You're missing some basic semantics in there, and you're nesting of fields isn't by type. The big "flubs" to my mind is having the checkbox in the same fieldset as text fields, and using label to do legend's job.

Something more like:
https://codepen.io/jason-knight/pen/zYJRdGR?editors=1100
We are all, we are all, we are all FRIENDS! For today we're all brothers, tonight we're all friends. Our moment of peace in a war that never ends.

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: HTML & CSS seems messy and all over place, can you help...
« Reply #2 on: 14 Mar 2023, 06:44:48 am »
You're missing some basic semantics in there, and you're nesting of fields isn't by type. The big "flubs" to my mind is having the checkbox in the same fieldset as text fields, and using label to do legend's job.

Something more like:
https://codepen.io/jason-knight/pen/zYJRdGR?editors=1100

Thanks, I appreciate that, I wasnt expecting that kind of answer to be honest, so I must be doing better... :)

so instead of grouping the CSS by the ID/names I should group by types?
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 1060
  • Karma: +188/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: HTML & CSS seems messy and all over place, can you help...
« Reply #3 on: 20 Mar 2023, 10:48:08 am »
so instead of grouping the CSS by the ID/names I should group by types?


Saying what something IS comes in many forms. You could say that the content is "post data" or some such, but what's really going on there is you had a set of text driven fields, as opposed to checkbox/radio fields. Since checkbox and radio should in most cases have their own fieldsets anyways, say what the content markup IS, not what the content would/might be.

It's another of the subtle bits of semantics that doesn't occur to most people. It's ok to say what the content tags are. Its' ok to say what the content is. It's ok to group them by either type as appropriate.

The only thing it's not ok to say is what you want things to look like on screens.
We are all, we are all, we are all FRIENDS! For today we're all brothers, tonight we're all friends. Our moment of peace in a war that never ends.

 

SMF spam blocked by CleanTalk

Advertisement