Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

just some very broad questions about html css javascript relationship!

ok so i know basic html css javascript...in there own file i know whats going on..i think? what is hard to understand is the relationship between the three...im really struggling to figure out how to style javascript with css knowing..

question 1.. is it standard to just style html with css? if you want to style js do you have to append to the DOM first?

question 2.... what has triggered this question...im making a little lotto program don't worry bout the full code, what i want to know to start is..

how do i style:

var myArray = [1,2,3,4,5,6];

i want to style each individual element of the array..i just don't know how to style javascript I'm only competent with html css.. what do have to do? i feel there are multiple ways even with jQuery which I'm learning.

i have an array in javascript and i want to style each element of the array? i would love the answer I've tried and I'm just a beginner so syntax errors have held me from the answer i think..

thank you for your help

1 Answer

You don't style javascript, so you can't style the array. Your javascript can dynamically create and manipulate html on the page, and than style the html with css.

Just keep this in mind, html is for your structure. It Structures content on your page in a hopefully logical way. Css can modify the appearance of the html, and javascript can be used to add elements into the html, remove elements from the html, or move elements around.

Hopefully that helps.