[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Looking for alternate CSS syntax

Posted on 2011-10-20
6
Medium Priority
?
283 Views
Last Modified: 2012-05-12
I find this syntax not too nice:
<a id="htmlLink" class="button inline btnNotification iframe complete"...>

What alternatives are there?

How about in C#, how could I realize the same result with the fluent CSS API?

Thanks.
0
Comment
Question by:newbieweb
  • 3
  • 3
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 37003402
I have no Idea how it would ever be necessary to use that many classes for a single link.  I think you may need to consolidate you stylesheets a little.
0
 

Author Comment

by:newbieweb
ID: 37003426
OK. Then why not create one that's more normal, then show me how to code the same thing using the CSS fluent API?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 37003517
What alternatives are there?

I gave you the best alternative... clean up your CSS.  

If you want me to show you how then post the CSS that forces you to uses that many classes.  The way it is you might as well be hardcoding the stlye in the tag.

As for C#, I have never written a singe line of code using C#.  It is not something I would ever use instead of PHP.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:newbieweb
ID: 37003543
That was sample CSS, not from my program. I was trying to learn other ways to concatenate classes, aside from just putting a space between them.

Sorry, maybe this fluent API is C# and not CSS. I have seen it before.

is uses
.addAttr() or something of the like.

or add('attr', 'iframe');

I wish I'd saved it when I saw it. Do you know what I am talking about?

I would like to learn PHP, sometime soon...
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 37003626
addAttr look like it might be an alias for the setAttribute method of the DOM.  It suggests that the styling is being generated dynamically as a one-off instead of using a stylesheet.  In my opinion, that would create some debugging and maintenance issues, but I don't know C# so maybe that is a viable approach.


I would like to learn PHP, sometime soon...

It is easy to learn the basics, and anyone who has coded javascript already know most of the syntax.  The best part is that it is open source and free, so there is a huge amount of support, and a lot of scripts already written an available to be plugged into projects.

Iam starting to sound like a promoter so I better shut up before Mircrosoft gets mad at me. ;)
0
 

Author Closing Comment

by:newbieweb
ID: 37003644
Thanks for the help. I knew nothing about PHP but now know it's like JavaScript, which I really like. See you on the PHP boards!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question