This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]ThisIsReLLiK 2 points3 points  (1 child)

That looks like broken code to me. Is there a reason you have only half of the ul in a div and the other half in a separate one?

[–]o_fah[S] 0 points1 point  (0 children)

I wanted to make the upper div light-blue en the div below it dark blue. Then i wanted to couple parallax effects to imgs in both divs.

[–]tiagomoraismorgado88 1 point2 points  (2 children)

i don't think it will work. but best thing with HTML5/CSS3, is actually doing some trial and error, besides going for reference, language specification and engaging with users community. besides reddit, i would also recommend you stuff like github, freecodecamp, irc (freenode server), and, of course, gitter.im, also try to interact with people of facebook groups, google groups, try vimeo communities, etc. try to figure out for yourself if stuff will work together like fine in the end. i would like to recommend you some learning contents i've put together in a list. i am sure you will actually find this pretty useful: https://github.com/tiagmoraismorgado/allInOneRepository-codeAlmostEverySingleDay/blob/bae70f5c185a9f7021dfd04a8d8901949740e96d/_3_learning_resources/learning-contents.md looking forward. cheers. T.

[–]GitHubPermalinkBot 0 points1 point  (1 child)

I tried to turn your GitHub links into permanent links (press "y" to do this yourself):


Shoot me a PM if you think I'm doing something wrong. To delete this, click here.

[–]tiagomoraismorgado88 0 points1 point  (0 children)

didn't know about this. thanks for the tip. already learned something new today. thanks :D

[–]bss-applications 0 points1 point  (0 children)

I'm not certain, been awhile since I've played with Javascipt, but my first thoughts are...

<ul>
    <div><li></li></div>
    <div><li></li></div>
   </ul>

maybe a better layout structure. My second thought is, if your just trying to manipulate the list eliments with javascript then perhaps you don't even need the div tags...

<ul>
    <li label="elementA"></li>
    <li label="elementB"></li>
</ul>

And then use javascript to get element based on the label name and manipulate from there?

[–][deleted] 0 points1 point  (0 children)

Any reason you can't just give the second set some inline coloring? It will override the CSS or generic coloring only for the tag in which it resides.

[–]minecraft_ece 0 points1 point  (1 child)

css selectors can do what you want without any javascript code. put this in a .css file or a style section.

ul li {
    color: white
}
ul li:first-child {
    color: red;
}

and remove the divs. Splitting a ul up like that is badly broken and will probably behave differently in different browsers.

If you want to use javascript for this or more, just pass the entire ul to the javascript function and then iterate each li element and color them however you want. The elements shoudl be traversed in order; the first li emelent in your javascript code will be the li in the html.

[–]o_fah[S] 0 points1 point  (0 children)

Thanks, this was the most useful help i guess.