Well, to CSS is not proper english, but my question is, for ASP .Net, or web design in general, should I use CSS for positioning or not?
I use it for some things here and there, but I have heard that CSS should be used as opposed to tables for positioning. Is this truly the better way? Doesn't it make it difficult to work through the HTML?
What are your views, opinions, or feelings?
-
-
Hey qwert!
I think you should use a mixture - being fanatical (which i've seen waaaay too many designers be) is just going to make you work extra hard when trying to achieve something..
seriously though - i use a mixture...sometimes for positioning, sometimes for colours and sometimes for effect - but in heart i stay with tables - it's my pet love and i'm faster with tables than i am with CSS (could of course be the lack of practise/need to keep to one technology only).
Regardless, quiet a few of the web controls that you use renders the html in tables - so ultimately it doesn't really matter.
KISS ~ Keep it so simple ~ whatever makes you rock -
qwert231 wrote:Well, to CSS is not proper english,
Sure it is - you're just reading it wrong
. For me, CSS (and many acronyms) are full-fledged words now.
CSS is simply pronounced See'esess. Just like GUI is pronounced "Gooey" and RAM is pronounced, umm, RAM.
A name is a noun, and every noun can be verbed.
Verbing Weirds Language. This is a good thing.
-
I've started living by a rule of thumb when it comes to using CSS: If you start putting tables inside of tables, there's a better way.
It may not be as cut an dry as that, but that's what I try to live by. Divs imbedded inside of divs are easier to work with and look cleaner than tables inside of tables.
Personally I think it is much easier to size divs and spans and move them around to where you need them than it is to do the same with tables. Tables seem to be a bit more difficult at times.
However if you need stuff lined up in columns, tables are definately a lot easier to work with.
On the other hand, if you need to figure out where stuff should be based on how much content is on the page, it probably is easier to perform the positioning using code.
I generally try to keep all of my stylizing in CSS because visual changes don't require a recompile. -
Yggdrasil wrote:
Sure it is - you're just reading it wrong
. For me, CSS (and many acronyms) are full-fledged words now.
Well, I know CSS is used as a word, but more as a noun than a verb. -
If Google can be a verb, then why can't CSS?
I'd say try to use CSS as much as possible. It can be done, and has advantages in the long run.
Of course, you must use CSS sensibly, not like this guy.
-
CSS is more complicated to do, especially considering the state of affairs with IE's standards conformance. Too many hacks, with the need to test in at least two browsers.
That said, CSS offers a lot more than table layout could hope to. It reduces the page code, which is good. It provides flexibility. Etc., etc. For a good example on what CSS can do, check out http://www.csszengarden.com. The seperation of concerns is a good thing. -
It's extremely hard work because of browser incompatabilities but definitely the way to go - separation of presentation and content and accessibility instead of endless HTML junk.
For some amazing examples of what can be achieved check out http://www.csszengarden.com/ - one simple page, many, many different designs using CSS to change the basic page. It's a real eye-opener to the power of CSS.
A book explaining the history of the site and talking you through the issues and reasons behind the designs has just been published by O'Reilly and it's excellent (and very glossy). ISBN 0-321-30347-4. Read it and be inspired!
If only more of the ASP.NET team would get their heads round this stuff we might end up with a decent .Net IDE and some server controls that DIDN'T generate garbage XHTML (I can dream!) -
Now somebody tells me that Grid Layout is the way to go. I thought that Grid Layout generated CSS for the client? At least it seems to, it places CSS info into my tags.
-
Is the CSS embedded when you do this? e.g. <span style="foofoofoo">. If so then I guess that is a start. The thing about css is that it is suppose to create a separation between your styles and content. So ideally you will create a css file and have a <span class="foo">. BUT we are talking vs.net 2003 and it is pretty awful when it comes to markup. I hear that 2005 is better but I dont have a machine to put it on
.
I would just stick with what you are comfortable and most effecient with. -
qwert231 wrote:Now somebody tells me that Grid Layout is the way to go. I thought that Grid Layout generated CSS for the client? At least it seems to, it places CSS info into my tags.
Okay, quick lesson in XHTML compliance
a) They're not called "tags", they're called "XML Elements"
b) Secondly, "Grid Layout" is a myth. Its just an "easier way" to describe "body element relative absolute positioning"
c) And it isn't really encouraged, as it means everything is fixed in place. The media of the WWW, the "web-page" is defined as having finite width and infinite height, elastic and fluid UIs are how websites should work, the "Webforms/Winforms" paradigm created by Microsoft in VisualStudio.NET is a Very Bad Thing(tm), you need to appreciate the vast differences in the platforms
d) The style="" global attribute is discouraged in favor of selector hooks and external sheets. Ideally, you shouldn't have ANY presentational information in your page whatsoever. Classnames and ID attribute values do not count as presnetational information when they're semantic and accurately describe the element's role in the page.
i.e.: Classnames such as "emphasised-heading" are encouraged, Classnames such as "bigger-font" are not.
When doing CSS, you need to get used to the box-model and ditch the "table-thinking". Think of layouts in terms of floats, boxes, positioning (absolute, fixed, relative, and none), and more.
Note that when you use a Strict DTD on a page, many browsers alter table handling in such a way that PREVENTS them from being reliabily used for layout purposes.
--
-WebStandardsMan (Google for me
)
-
W3bbo wrote:
Okay, quick lesson in XHTML compliance
[...]
b) Secondly, "Grid Layout" is a myth. Its just an "easier way" to describe "body element relative absolute positioning"
[...]
I would like to add :
"Layers" do not exists. It's the Dreamweaver-qualifier for "absolute positionned <div> elements
-
Next question, since VS doesn't have too good a CSS layout tool, is there one? Is there a tool that let's you drag and drop elements for a page, but have those locations saved in a CSS file?
-
great question. I would be interested in something like that too.
-
I think you can do that with style master ($59.99). Developer is keen on web standards, so I would expect you would get nice clean CSS generated.
Not seen any good free CSS editors (plenty of tools that do syntax highlighting, but not with a WYSIWYG part). -
notepad is by far the best css editor microsoft has ever made.
-
some1else wrote:notepad is by far the best css editor microsoft has ever made.
[Sarcasm /]
Sheva
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.