Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
Why does it matter that HTML and CSS are not programming languages?

As I understand a programming language is something that can be used to solve a problem/perform an alogrithm. Then someone just said to me "I programmed a website using HTML, JavaScript, and CSS", and my immediate reaction was HTML and CSS are not programming languages, then remembered the L in HTML means Language. But still it is "Markup Language".

So are CSS and HTML programming languages? I they are they can't be in the same boat as languages like C, in C the order of instructions is crucial, but in CSS you can have rules and selectors in any order, and in HTML the order of the tags matter, so there must be some subclassifaction of languages, where CSS/HTML/similar are in one and C/Python/etc are in the other?

share|improve this question

marked as duplicate by Dean Harding, Glenn Nelson, MainMa, Mark Trapp Jan 9 '12 at 1:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
What do you think you mean by "programming language"? Do you mean a "Turing Complete" language? Or do you mean "something can be used to solve page layout problems?" Or do you mean "something that can be used to represent information"? –  S.Lott Jan 9 '12 at 0:05
    
I thought it meant something that can implement an algorithm? –  Jonathan. Jan 9 '12 at 0:10
    
@Dean, sorry I didn't see that, however what does it mean by declarative and imperative –  Jonathan. Jan 9 '12 at 0:10
2  
Declarative is when you say "this is what I want to happen." Imperative is when you say "this is how I want to do this." For example, in CSS you would say "this paragraph should have a blue border" (declarative) whereas in Javascript you might say "draw a blue line from (x1, y1) to (x2, y2), etc" (imperative). –  Dean Harding Jan 9 '12 at 0:30
    
No, they're just text markup and style hinting. While CSS may use some elements that are structured like bash scripting, it's just an identifier followed by a semicolon delimited list within curly braces. HTML is like the early days of WordStar when you could hand enter markup and then flip back to simulated page display. The biggest problem I'm facing at the moment is interviewing people who think they're programmers because they can design web pages in Notepad+. Now Javascript is an actual language you can do stuff with... –  Fiasco Labs Jan 9 '12 at 0:31

4 Answers 4

Technically yes, but it wasn't really designed to be one.

CSS+HTML actually is turing complete because you can encode Rule 110 in CSS.

That said, it would be prohivitively impractical to try to write programs in HTML and CSS.

People who say the "program in HTML" are generally mistaken about programming. HTML is a markup language and CSS is a stylesheet language. HTML is designed to store content hierarchically and CSS is designed to customize how the content is displayed. HTML and CSS are meant to express presentation, whereas code typically is written to do something, that is, to have some sort of function.

share|improve this answer
    
Would downvote, purely because you neglected to mention this was "HTML5" and "CSS3". Took me on a merry journey. –  JackWilson Nov 20 '13 at 11:00

No, CSS is a style sheet language which describes the appearance of markup (text with contextual definitions called "tags"). I've never met an experienced programmer who considers CSS/HTML programming languages. Doesn't mean you can't do cool stuff with them (especially HTML5/CSS3), but they don't particularly, logically instruct the computer to perform specific calculations and operations.

share|improve this answer

No: (as I understand this), absence of for/while loops and if statements. Generally when "programming language" is mentiones, means Turing complete Programming language, one link here.

CSS, XML (therefore HTML) are markup languages.

share|improve this answer
2  
CSS isn't a markup language, it's a stylesheet language. You don't write markup in CSS. –  Peter Olson Jan 9 '12 at 0:43
    
@PeterOlson Correct... How could we say that this makes it "more" a markup than a turing complete one? –  dimitris mistriotis Jan 9 '12 at 9:50

Cascading-Style Sheet or CSS is not a programming language. It is a mark up language used with HTML to design the user interface of a website (the style is applied to the mark up language through out the same sections of similar parts).

Programming languages have the ability to perform algorithms to calculate equations or perform low level machine based operating instructions and tasks.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.