943,909 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Apr 10th, 2008
0

Diagonal rules in CSS?

Expand Post »
Hello,

I'm familiar with the ability to create borders and boxes in CSS, but I have a client that has requested diagonal rule to cross through table cells. That is, no matter the dimensions of the table cell, it would contain an X of a specified color.

Any advice on creating this? Thanks!
Reputation Points: 10
Solved Threads: 0
Light Poster
Tom Tolleson is offline Offline
39 posts
since Oct 2007
Apr 10th, 2008
0

Re: Diagonal rules in CSS?

Can't you just create a css class with a background image of the X in question,set it to repeat and assign that class to the necessary td tag?
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
TommyBs is offline Offline
61 posts
since Mar 2008
Apr 10th, 2008
0

Re: Diagonal rules in CSS?

Well... I'd go with something similar to ...TommyBS...

You can put in an image and tell it to be 100% 100%... that would get the result you are after... sort of.
I suppose if oyu really want to have content on top of it, you could use relative positioning and z-index.


The problem is diagonal lines aren't really done with CSS.
So you have to find a way to make it "look" like it.
Css BG images won't likely work as you cannot tell them to take u pa certain dimension (it's tile or not, thats it as far as I know). (thus why I said an inline image).


I suppose it could be done.... 3 or 4 spans... a different image in each (triangle), and then nest them, positioning the image partling off... could work (but is that much extra markup worth the result?)
Reputation Points: 63
Solved Threads: 12
Posting Pro in Training
autocrat is offline Offline
427 posts
since Feb 2005
Apr 10th, 2008
0

Re: Diagonal rules in CSS?

unless you know the fixed size of the table cell you will never get an exact fit which is why I still believe that a background image is the best idea. If you want to PM i don't mind sending you an example. Just to be even more controversal I'm going to ask why you are using tables at all and not just CSS!
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
TommyBs is offline Offline
61 posts
since Mar 2008
Apr 11th, 2008
0

Re: Diagonal rules in CSS?

Just to be even more controversal I'm going to ask why you are using tables at all and not just CSS!

It's a Federal Govt. contract and they have people who aren't developers trying to make design requests. I'm the only real developer in my group, so people come to me with ideas in odd contexts (such as an 'X' from CSS in a table). I wasn't sure about this one, so I thought I'd ask.

Thanks for all the advice guys! I'm going to advise them to go with the image or a sold background-color table cell instead. You've been a big help!
Reputation Points: 10
Solved Threads: 0
Light Poster
Tom Tolleson is offline Offline
39 posts
since Oct 2007
Apr 11th, 2008
0

Re: Diagonal rules in CSS?

"they have people who aren't developers trying to make design requests"

Developers shouldn't be making design decisions either, unless they are skilled in that trade. Designers and developers use 2 completely different skill sets.
J_R
Reputation Points: 10
Solved Threads: 0
Newbie Poster
J_R is offline Offline
7 posts
since Apr 2008
Apr 11th, 2008
0

Re: Diagonal rules in CSS?

Sorry... going to disagree on that one.

If you let designers design, with no input from developers or users, then you are running the risk of getting a website that will fail.

You need input from all angles, through every step, from conception of ideas through to final coding.


Otherwise you end up with a site that is like 95% of those out there... inaccessible, poor usability and killing conversions as soon as people look a the site.


Plan, research, conceive, test, refine, develop.
Then repeat several times over.
Reputation Points: 63
Solved Threads: 12
Posting Pro in Training
autocrat is offline Offline
427 posts
since Feb 2005
Apr 12th, 2008
0

Re: Diagonal rules in CSS?

This is a case where computer rules overrule the federal government.

Javascript might be useful here. But they are asking for things that are generally not supplied.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Apr 12th, 2008
0

Re: Diagonal rules in CSS?

Click to Expand / Collapse  Quote originally posted by autocrat ...
Sorry... going to disagree on that one.

If you let designers design, with no input from developers or users, then you are running the risk of getting a website that will fail.

You need input from all angles, through every step, from conception of ideas through to final coding.


Otherwise you end up with a site that is like 95% of those out there... inaccessible, poor usability and killing conversions as soon as people look a the site.


Plan, research, conceive, test, refine, develop.
Then repeat several times over.
Sorry, but what you're describing - accessibility, usability, etc. - are all skills that the design team need. A development team needs to know HOW to code it. A good design shouldn't be compromised by a coder. That's Programming 101.
J_R
Reputation Points: 10
Solved Threads: 0
Newbie Poster
J_R is offline Offline
7 posts
since Apr 2008
Apr 13th, 2008
0

Re: Diagonal rules in CSS?

ANd thats why so many Programmers have to use skills from other people!

Please, think logicially.
If you have a TEAM, then it needs to work as one.
Therefore everyone in volved has to have input and contribute.

Far to often I've seen professionals with amazing knowledge and prowess in their profession screw a project up by not listening to the input of others.

How many Designers are aware of Browser inconsistencies, the limitations of space and the various alterantions that a user can force onto a design?

Not many - thats why everyone needs the input.

Saying it's down to the 'coder' to make up for there lack of knowledge wastes time, as that person as t ospend a lot longer going over the variou problems the design has caused, and fix them.

Instead, with a little common sense and communicaiton, you can get a fantastic design (even complicated, convulated and highly attractive!), and still get it working in every damend browser, still have the text resize and have it work with assistive/alternative technologies without additional programming.

And Comprimise is the key.
Without comprimise, you get stubborn people ruining the end result.
Reputation Points: 63
Solved Threads: 12
Posting Pro in Training
autocrat is offline Offline
427 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: struggling with css
Next Thread in HTML and CSS Forum Timeline: Help with Forms





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC