html - CSS adding elements inside elements? -


I have 4 elements "block" "button 1" button 2 "and" label ".

I block is to be placed under the button by CSS. This can be done by HTML in this way:

    class = "Label">  one square = "button 1">  & lt; one class = "button2" & gt; & lt ; / A & gt; & lt; / p & gt;   

But it will take up a lot more space than 50 times in one place.

Change the button '12 'href to the least button as a possible line of code

CSS is to modify the appearance of a page, and not used to add content - Although pseudo elements such as : before and : after are commonly used for decorative purposes (for example, adding arrows, or layout hanks)

Have you considered using a JS based method? You can loop through all the .block elements and then enter the labels and buttons in each of them.

An example of a JS-based method would be: (assuming you are using JQuery) $ (document) .ready (function () {$ ("Block"). (Function () {// var apnd = & lt; element & gt; & lt; / element & gt; '// Add Elements $ (apnd). AppendTo ($ ( This));});});

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -