Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

string concatenation in css

Tags:

html

css

I want to achieve the following in css. How do i do it in a way that works in IE8+

url('../img/icons/' + attr('type') + '_10.png') 
like image 988
aWebDeveloper Avatar asked Apr 01 '13 14:04

aWebDeveloper


People also ask

What is concatenation CSS?

0.0, the concatenation feature allows concatenation of the multiple web resources that are used by the application (JavaScript and CSS files) into a smaller number of files. Reducing the total number of files that are referenced by the application HTML results in fewer browser requests when the application starts.

How do you concatenate variables in CSS?

Since you can't concatenate in CSS (aside from the content property), CSS variables can not be concatenated. This means, for example, you can't combine a CSS variable that is a number with a unit.

What is string concatenation example?

In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalisations of concatenation theory, also called string theory, string concatenation is a primitive notion.

What is concatenation of a string?

The concatenation operators combine two strings to form one string by appending the second string to the right-hand end of the first string.


1 Answers

I don't think you can. In the content property you can "concatenate" just by separating with a space, but in other places I don't think there is such a feature. Which is a shame.

You'll probably be best off specifying this style in a style attribute whenever the type attribute is used.

like image 138
Niet the Dark Absol Avatar answered Sep 29 '22 08:09

Niet the Dark Absol