-1

I want to do a site so simple it hurts.

I need a fixed side bar with some links.

I need a main window with a scrollbar that scrolls only the main window, not the side bar altogether.

Can I do this without creating 3, 4 or 5 divs, mains, navs, asides, sections, articles or whatever?

Can I do this without more than 10, 20 or 30 lines of css?

The examples in this answer comes close to what I want. But to have 38 lines of CSS to something so simple seem just ridiculous.

Community
  • 1
  • 1
Rodrigo
  • 4,706
  • 6
  • 51
  • 94
  • Your request shows you don't understand the purpose of `CSS`. It is a set of rules and conventions used to increase the ability to maintain and change the visual aspect of `HTML` elements separately from the actual markup. The reason people write it on multiple lines is so it remains readable and maintainable. In production it should always be minified and served as one single line. Besides, it is totally optional. You can place all your styling rules in markup. But the more visual rules, the harder to manage inline. – tao Feb 12 '17 at 22:45
  • Maybe I don't really understand it. But if you search, you'll find lots of sites explaining why CSS sucks. Probably that's just something inherently wrong with it, just like the absurd that are the browsers horrible habit of keeping out of standards. – Rodrigo Feb 12 '17 at 22:57
  • You weren't here when websites made of thousands of pages were done in `html` alone and some big shot came to you and said: I want all titles red, not blue. And that meant changing on each of those pages. I made a really [spartan layout](https://jsfiddle.net/websiter/017e58t8/1/) for you, without any "CSS". Has minimal styling rules, per your requests, but no "Cascading style sheets", nor does it use classes. I hope you like it. `

    `s are not closed on purpose, on same bare-bone principle (closing tag is optional and browsers will close it when next `

    ` tag is met. Take care.

    – tao Feb 12 '17 at 23:15
  • And... *if you search you'll find lots of sites*... really? Is that an argument? You won't find sites that do not use `CSS`. How is that for an argument? *If you search, you'll find lots of sites...* telling you a lot of b\*s\*, like let's blow everyone up or let's eat children. How would I sound if I served that as an argument to do any of those? Maybe there's something inherently wrong with the internet. Or with humans? I don't know. I really don't know... – tao Feb 12 '17 at 23:23
  • Well, you understand me wrong. The idea behind CSS is great. But the way it was implemented, and the way it is today, is just sad. I have programmed in many different languages, used a few scripting languages as well, but never seen anything so user-unfriendly as CSS. Maybe I'm wrong. But if you want real arguments, just try one of the sites I mentioned. Google for "why css sucks". You'll find lots of arguments. – Rodrigo Feb 13 '17 at 00:06
  • I read the first one, written by raizlabs. I commented on it and it would be interesting to see if my comment is approved. If you're interested to read it, I made a copy in [`this fiddle`](https://jsfiddle.net/websiter/u2mvcx5a/embedded/result/#Result). I apologize for engaging in this somewhat unproductive discussion. In general, I'm trying to be helpful. My best regards, – tao Feb 13 '17 at 01:44
  • Thank you. No problem at all, we should always be open to what others think, mostly if it's different from what we think. Best regards. – Rodrigo Feb 13 '17 at 01:59

1 Answers1

1

This is a minimum setup for what you are trying to achieve: https://jsfiddle.net/jv891nv8/1/

It simply have a content div, and a

position: fixed

sidebar. From here you can modify to what you like.

Dave Plug
  • 1,068
  • 1
  • 11
  • 22
  • Great. But I first wanted the side bar on the left. And changing `left: 0;` for `right: 0;` just don't work. I hate how CSS can be so counter-intuitive! – Rodrigo Feb 05 '17 at 00:47