Re: R: [WSG] Alternative to align = center?
CSS classes are for presentation. Content is content. Centering content is presentation. Class names should not use keywords such as center. centre is not a keyword and can be used. The class centre can then be used anywhere centering is desired. It is quite easy to remember what this class name does, but if you wish to use some more obscure name, feel free. On Sat, May 3, 2008 2:33 pm, Joseph Taylor wrote: FYI - Adding such a named class, especially with the name center or center goes against separation of presentation and content. In a situation where your HTML looks like: div div class=centre my images / /div div class=centre my images / /div div class=centre my images / /div /div You should change it to something like: div id=my_section div my images / /div div my images / /div div my images / /div /div Then your CSS rule could look more like: #my_section div { text-align: center; margin: 5px; } One day you'll wish that div didn't have the class name of center, especially if there are a bunch of them. Just give an id to the container that would hold them all and use your css selectors to isolate the elements you wish to style. In the end, either choice will create the same effect. This one is a little more future proof. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Stuart Foulstone wrote: Or use a CSS class to do the same, div class=centre and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=text-align: center ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=center is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. Ive resorted to creating a bbcode tag that uses div align=center as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? Id be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
Stuart Foulstone wrote: CSS classes are for presentation. Content is content. Centering content is presentation. Class names should not use keywords such as "center". "centre" is not a keyword and can be used. The class "centre" can then be used anywhere centering is desired. It is quite easy to remember what this class name does, but if you wish to use some more obscure name, feel free. But the class attribute (centre) is not css. css is what you apply to that class. Markup is markup. Css is css. -- Kind Regards Chris Price [EMAIL PROTECTED] www.choctaw.co.uk Tel. 01524 825 245 Mob. 0777 451 4488 Beauty is in the Eye of the Beholder while Excellence is in the Hand of the Professional ~~ Sent on behalf of Choctaw Media Ltd ~~ Choctaw Media Limited is a company registered in England and Wales with company number 04627649 Registered Office: Lonsdale Partners, Priory Close, St Mary's Gate, Lancaster LA1 1XB United Kingdom ***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***
Re: R: [WSG] Alternative to align = center?
Stuart Foulstone wrote: It is quite easy to remember what this class name does, but if you wish to use some more obscure name, feel free. And if, at a later date, you change the CSS for a different layout, you potentially end up with class names that suggest one thing when they actually do another (e.g. .centre { float: left; } ) ... P -- Patrick H. Lauke __ re·dux (adj.): brought back; returned. used postpositively [latin : re-, re- + dux, leader; see duke.] www.splintered.co.uk | www.photographia.co.uk http://redux.deviantart.com __ Co-lead, Web Standards Project (WaSP) Accessibility Task Force http://webstandards.org/ __ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
CSS classes are for presentation. Content is content. Centering content is presentation. Class names should not use keywords such as center. centre is not a keyword and can be used. The class centre can then be used anywhere centering is desired. It is quite easy to remember what this class name does, but if you wish to use some more obscure name, feel free. But the class attribute (centre) is not css. css is what you apply to that class. Markup is markup. Css is css. Is it just me or has this list suddenly become a Zen poem society? Russ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
On 4 May 2008, at 12:47, Stuart Foulstone wrote: CSS classes are for presentation. There is no such thing as a CSS class. CSS is for presentation. HTML has classes. CSS selectors can match against HTML classes. Content is content. True Centering content is presentation. True Class names should not use keywords such as center. The specification does not forbid this. Keywords are context sensitive. It is generally good coding style to avoid it as it reduces confusion, but good coding style also suggests that HTML class names focus on the WHY not the WHAT - i.e. the reason for the presentation, not what the presentation is. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
I suppose it wouldn't matter if you used a class or id, but the id can be linked to from within the document, so if your page had a table of contents or something, you could jump from point to point. Id's have to be unique on the page, so they are perfect for attaching to the unique sections of the document, so you could structure a document like: div id=header div id=logo / div id=nav / /div div id=content / div id=main_content / div id=sub_content / /div div id=footer / This makes css more specific. I can easily say make all text in my main content 100%, but sub content should be smaller and lighter lets say: #main_content { font-size: 100%; color: #000; } #sub_content { font-size: 80%; color: #666; } Or you could get really specific, lets say the only links on the page that wouldn't be underlined would be links within unordered list items that are nested within other list items, and only in the subcontent section: #subcontent ul li ul li a { text-decoration: none; } Any other links in lists would be left alone. This specificity with no extra classes - all thanks to one id set on a parent element. As far separation, the less classes etc you have in your document the better I say since the raw document needs none. As soon as you add classes etc you begin to intertwine the two. Obviously its a huge improvement from tag soup even with a bunch of classes all over the place. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Michael Horowitz wrote: Can you explain to me a little bit more of the theory of why you would want to use and id vs a class called center is this type of situation. Trying to understand more how this becomes an issue of separating presentation and content. Thanks Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Joseph Taylor wrote: FYI - Adding such a named class, especially with the name center or center goes against separation of presentation and content. In a situation where your HTML looks like: div div class=centre my images / /div div class=centre my images / /div div class=centre my images / /div /div You should change it to something like: div id=my_section div my images / /div div my images / /div div my images / /div /div Then your CSS rule could look more like: #my_section div { text-align: center; margin: 5px; } One day you'll wish that div didn't have the class name of center, especially if there are a bunch of them. Just give an id to the container that would hold them all and use your css selectors to isolate the elements you wish to style. In the end, either choice will create the same effect. This one is a little more future proof. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Stuart Foulstone wrote: Or use a CSS class to do the same, div class=”centre” and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=”text-align: center” ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=”center” is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. I’ve resorted to creating a bbcode tag that uses div align=”center” as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? I’d be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL
Re: R: [WSG] Alternative to align = center?
Yes, its really easy to add class names as you need them and there is a level where it seems both logical and usefuul. Sadly that is not the reality though. Patrick hit the nail in the head when he mentioned changing designs and having that once relevant class name end up attaching styles that no longer match the name you originally chose. Adding a class name of centre is just as bad as picking something like red. If you take a step back when preparing to apply classes to things, you'll find that you are always thinking all the links in the nav section or something to that effect, hence using the single class or id on the parent element and selectors to achieve what you want. To climb down fro the soapbox and into a working reality you have to break these rules sometimes. Every page I've ever made that uses any floats has somewhere a: div class=clear/div with matching css: div.clear { clear: both; } I could come up with fancy workarounds but in the midst of deadlines I'll add one superfluous element anytime. Same thing with my navigations: I always: ul lia href=#Link Textspan/span/a/li /ul Yes, the extra span shouldn't be there. Having it there always me to perform elegant image replacements and degrades gracefully. The mere site of that HTML may send some of our members to instantly flame that practice. The bottom line is that there is a pleasant middle ground that exists between perfect standards compliance and accomplishing what you want. Like anything else you should only break the rules if you know the rules - just in case Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] IceKat wrote: How is using a name which is descriptive and easy to remember and understand (like for those coming in after you've written the code) going against that separation? It's not actually putting the styling in the html and if anything it saves coding. If you have a class of center then you can define it in your stylesheet as .center{ text-align: center } and anything has that attribute, including divs, headings, paragraphs etc. Imagine creating and writing a class for everything like that which needs it! You'd wind up with 50 extra lines of code and a bigger file and therefore longer download time. Plus if it's a class then you don't have to worry about it being used more than once on a page and you know exactly which name to use when you need that attribute as will anyone else who comes across it later. IceKat Joseph Taylor wrote: FYI - Adding such a named class, especially with the name center or center goes against separation of presentation and content. In a situation where your HTML looks like: div div class=centre my images / /div div class=centre my images / /div div class=centre my images / /div /div You should change it to something like: div id=my_section div my images / /div div my images / /div div my images / /div /div Then your CSS rule could look more like: #my_section div { text-align: center; margin: 5px; } One day you'll wish that div didn't have the class name of center, especially if there are a bunch of them. Just give an id to the container that would hold them all and use your css selectors to isolate the elements you wish to style. In the end, either choice will create the same effect. This one is a little more future proof. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Stuart Foulstone wrote: Or use a CSS class to do the same, div class=”centre” and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=”text-align: center” ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=”center” is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. I’ve resorted to creating a bbcode tag that uses div align=”center” as that is the only way I can think of. Are
Re: R: [WSG] Alternative to align = center?
http://www.w3schools.com/CSS/css_syntax.asp The class Selector With the class selector you can define different styles for the same type of HTML element. Say that you would like to have two types of paragraphs in your document: one right-aligned paragraph, and one center-aligned paragraph. Here is how you can do it with styles: p.right {text-align: right} p.center {text-align: center} You have to use the class attribute in your HTML document: p class=right This paragraph will be right-aligned. /p p class=center This paragraph will be center-aligned. /p On Sun, May 4, 2008 1:12 pm, Chris Price wrote: Stuart Foulstone wrote: CSS classes are for presentation. Content is content. Centering content is presentation. Class names should not use keywords such as center. centre is not a keyword and can be used. The class centre can then be used anywhere centering is desired. It is quite easy to remember what this class name does, but if you wish to use some more obscure name, feel free. But the class attribute (centre) is not css. css is what you apply to that class. Markup is markup. Css is css. -- Kind Regards Chris Price Choctaw [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.choctaw.co.uk http://www.choctaw.co.uk Tel. 01524 825 245 Mob. 0777 451 4488 Beauty is in the Eye of the Beholder while Excellence is in the Hand of the Professional ~~ Sent on behalf of Choctaw Media Ltd ~~ Choctaw Media Limited is a company registered in England and Wales with company number 04627649 Registered Office: Lonsdale Partners, Priory Close, St Mary's Gate, Lancaster LA1 1XB . United Kingdom *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
W3Schools is not related to or sanctioned by the W3C. On Sun, May 4, 2008 at 3:02 PM, Stuart Foulstone [EMAIL PROTECTED] wrote: http://www.w3schools.com/CSS/css_syntax.asp The class Selector With the class selector you can define different styles for the same type of HTML element. Say that you would like to have two types of paragraphs in your document: one right-aligned paragraph, and one center-aligned paragraph. Here is how you can do it with styles: p.right {text-align: right} p.center {text-align: center} You have to use the class attribute in your HTML document: p class=right This paragraph will be right-aligned. /p p class=center This paragraph will be center-aligned. /p On Sun, May 4, 2008 1:12 pm, Chris Price wrote: Stuart Foulstone wrote: CSS classes are for presentation. Content is content. Centering content is presentation. Class names should not use keywords such as center. centre is not a keyword and can be used. The class centre can then be used anywhere centering is desired. It is quite easy to remember what this class name does, but if you wish to use some more obscure name, feel free. But the class attribute (centre) is not css. css is what you apply to that class. Markup is markup. Css is css. -- Kind Regards Chris Price Choctaw [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.choctaw.co.uk http://www.choctaw.co.uk Tel. 01524 825 245 Mob. 0777 451 4488 Beauty is in the Eye of the Beholder while Excellence is in the Hand of the Professional ~~ Sent on behalf of Choctaw Media Ltd ~~ Choctaw Media Limited is a company registered in England and Wales with company number 04627649 Registered Office: Lonsdale Partners, Priory Close, St Mary's Gate, Lancaster LA1 1XB . United Kingdom *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
On May 4, 2008, at 5:46 PM, Viable Design wrote: W3Schools is not related to or sanctioned by the W3C. and enjoys a certain notoriety for sometimes offering less-than- perfect advice. though when I'm in a hurry I still find it a useful resource as an aide memoire... Andrew http://www.andrewmaben.net [EMAIL PROTECTED] In a well designed user interface, the user should not need instructions. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
R: [WSG] Alternative to align = center?
What about div style=text-align: center ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=center is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. Ive resorted to creating a bbcode tag that uses div align=center as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? Id be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
Or use a CSS class to do the same, div class=centre and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=text-align: center ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=center is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. Ive resorted to creating a bbcode tag that uses div align=center as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? Id be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
FYI - Adding such a named class, especially with the name center or center goes against separation of presentation and content. In a situation where your HTML looks like: div div class=centre my images / /div div class=centre my images / /div div class=centre my images / /div /div You should change it to something like: div id=my_section div my images / /div div my images / /div div my images / /div /div Then your CSS rule could look more like: #my_section div { text-align: center; margin: 5px; } One day you'll wish that div didn't have the class name of center, especially if there are a bunch of them. Just give an id to the container that would hold them all and use your css selectors to isolate the elements you wish to style. In the end, either choice will create the same effect. This one is a little more future proof. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Stuart Foulstone wrote: Or use a CSS class to do the same, div class=”centre” and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=”text-align: center” ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=”center” is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. I’ve resorted to creating a bbcode tag that uses div align=”center” as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? I’d be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** begin:vcard fn:Joseph Taylor n:Taylor;Joseph org:Sites by Joe, LLC adr:;;408 Route 47 South;Cape May Court House;NJ;08210;USA email;internet:[EMAIL PROTECTED] title:Designer / Developer tel;work:609-335-3076 tel;fax:886-301-8045 tel;home:609-886-9660 tel;cell:609-335-3076 x-mozilla-html:TRUE url:http://sitesbyjoe.com version:2.1 end:vcard
RE: R: [WSG] Alternative to align = center?
There is the old faithful p aligncentreImage/p Which as far as I'm aware is valid in XHTML strict, or the method Stuart mentioned with the pre-set div tag. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stuart Foulstone Sent: 03 May 2008 10:37 To: wsg@webstandardsgroup.org Subject: Re: R: [WSG] Alternative to align = center? Or use a CSS class to do the same, div class=centre and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=text-align: center ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=center is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. Ive resorted to creating a bbcode tag that uses div align=center as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? Id be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.7/1410 - Release Date: 01/05/2008 17:30 *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
Speaking of centre. W3C ought to implement British English as well. :( But yeah, the align attribute should be avoided at all cost. If you really want to align something in the centre, use; margin: 0 auto; /Svip 2008/5/3 Essential eBiz Solutions Ltd [EMAIL PROTECTED]: There is the old faithful p aligncentreImage/p Which as far as I'm aware is valid in XHTML strict, or the method Stuart mentioned with the pre-set div tag. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stuart Foulstone Sent: 03 May 2008 10:37 To: wsg@webstandardsgroup.org Subject: Re: R: [WSG] Alternative to align = center? Or use a CSS class to do the same, div class=centre and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=text-align: center ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=center is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. I've resorted to creating a bbcode tag that uses div align=center as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? I'd be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.7/1410 - Release Date: 01/05/2008 17:30 *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
On 3 May 2008, at 20:30, Essential eBiz Solutions Ltd wrote: There is the old faithful p aligncentreImage/p Which as far as I'm aware is valid in XHTML strict It isn't. http://dorward.me.uk/www/centre/ explains how to centre various things with CSS. Images are inline, so text-align on the parent element works. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
Can you explain to me a little bit more of the theory of why you would want to use and id vs a class called center is this type of situation. Trying to understand more how this becomes an issue of separating presentation and content. Thanks Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Joseph Taylor wrote: FYI - Adding such a named class, especially with the name center or center goes against separation of presentation and content. In a situation where your HTML looks like: div div class=centre my images / /div div class=centre my images / /div div class=centre my images / /div /div You should change it to something like: div id=my_section div my images / /div div my images / /div div my images / /div /div Then your CSS rule could look more like: #my_section div { text-align: center; margin: 5px; } One day you'll wish that div didn't have the class name of center, especially if there are a bunch of them. Just give an id to the container that would hold them all and use your css selectors to isolate the elements you wish to style. In the end, either choice will create the same effect. This one is a little more future proof. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Stuart Foulstone wrote: Or use a CSS class to do the same, div class=”centre” and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=”text-align: center” ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=”center” is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. I’ve resorted to creating a bbcode tag that uses div align=”center” as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? I’d be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: R: [WSG] Alternative to align = center?
How is using a name which is descriptive and easy to remember and understand (like for those coming in after you've written the code) going against that separation? It's not actually putting the styling in the html and if anything it saves coding. If you have a class of center then you can define it in your stylesheet as .center{ text-align: center } and anything has that attribute, including divs, headings, paragraphs etc. Imagine creating and writing a class for everything like that which needs it! You'd wind up with 50 extra lines of code and a bigger file and therefore longer download time. Plus if it's a class then you don't have to worry about it being used more than once on a page and you know exactly which name to use when you need that attribute as will anyone else who comes across it later. IceKat Joseph Taylor wrote: FYI - Adding such a named class, especially with the name center or center goes against separation of presentation and content. In a situation where your HTML looks like: div div class=centre my images / /div div class=centre my images / /div div class=centre my images / /div /div You should change it to something like: div id=my_section div my images / /div div my images / /div div my images / /div /div Then your CSS rule could look more like: #my_section div { text-align: center; margin: 5px; } One day you'll wish that div didn't have the class name of center, especially if there are a bunch of them. Just give an id to the container that would hold them all and use your css selectors to isolate the elements you wish to style. In the end, either choice will create the same effect. This one is a little more future proof. Joseph R. B. Taylor /Designer / Developer/ -- Sites by Joe, LLC /Clean, Simple and Elegant Web Design/ Phone: (609) 335-3076 Fax: (866) 301-8045 Web: http://sitesbyjoe.com Email: [EMAIL PROTECTED] Stuart Foulstone wrote: Or use a CSS class to do the same, div class=”centre” and .centre { text-align: center; } On Sat, May 3, 2008 10:22 am, Diego La Monica wrote: What about div style=”text-align: center” ? Diego La Monica Web 2.0 - Standards - Accessibilità mobile: +39 3337235382 - skype: diego.la.monica web: http://diegolamonica.info - http://jastegg.it _ Da: Simon [mailto:[EMAIL PROTECTED] Inviato: sabato 3 maggio 2008 11.15 A: wsg@webstandardsgroup.org Oggetto: [WSG] Alternative to align = center? Hi, I know that the align attribute such as div align=”center” is not allowed in XHTML Strict, but it got me thinking on what the possible alternatives are for a dynamic environment such as a forum? For instance if I know the image width or the total width of all the images will be the same I usually put them in a wrapper with a fixed width and use margin: 5px auto as an example. What happens if you will never know the width of the images or how many images someone may post, as happens on a forum I run. I’ve resorted to creating a bbcode tag that uses div align=”center” as that is the only way I can think of. Are these scenarios always doomed to use transitional doctypes and deprecated code? I’d be interested in your opinions Cheers Simon *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***