aidenmead sends brownie points to @vasejs :sparkles: :thumbsup: :sparkles:
:cookie: 546 | @vasejs |http://www.freecodecamp.org/vasejs
display
mode on the H1 header to display: inline;
or something so that it isn't display: block;
which is the default.
.border
that is overriding your setting because it has the !important
flag on it. (I think that it is a setting in Bootstrap.) If you change your class name to something like .borderRed
and add that name to your div, then you'll get your red border.
justify-content-end d-flex
is not working would tryingout normal flex work?
dmsalati sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3765 | @khaduch |http://www.freecodecamp.org/khaduch
@DMsalati - the border is only applied to the elements that have that property (which is adding the red border) So you have a div
<div class="redBorder">
<h1>The header</h1>
<div class="other classes for the buttons">
<button>ALL</button>
<button>ONLINE</button>
<button>OFFLINE</button>
</div>
</div> <!-- this closes the div that has the red border ==>
So the div with the red border has the div with the buttons as a child element, so it surrounds all of the child elements with the red border. Just changing it to this:
<div class="NOT_the_redBorder">
<h1 class="redBorder">The header</h1> <!-- just add the red border to the h1 element -->
<div class="other classes for the buttons">
<button>ALL</button>
<button>ONLINE</button>
<button>OFFLINE</button>
</div>
</div> <!-- this closes the div that no longer has the red border -->
That will just put a border around the <h1>
and everything else will not have the red border. You might have to play around with it a little, but that's what I'm getting at.
col-md-6
is going to take half of the width of that container div, so you might want or need to expand that.Hi guys! I have a quick question about this bit of code:
var myArray = [];
var i = 0;
while (i < 5) {
myArray.push(i);
i++;
}
What exactly does “i++” mean in this code?
It’s supposed to be i + 1, right? So, why is it that if I change it to i + 1 instead, the code editor gives me an error and says I have a potential infinite loop?
i += 1
i + 1
don't change your initial i, so it will stay 0
thus it will go to infinite loop. you have to assign it with =
@krennical_twitter
This is also valid (and saves a line)
while (i < 5) {
myArray.push(i++);
}
romchyfcc sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 324 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
easier
.. But if you're doing it improve your overall coding skillset, vanilla js would be more effective
function lookUpProfile(firstName, prop){
// Only change code below this line
var tempFN = firstName;
var tempProp = prop;
for (var i = 0; i < contacts.length; i++) {
if (tempFN == contacts[i].firstName) {
return contacts[i].tempProp;
}
}
// Only change code above this line
}
@maxiwer
The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact.
You arent checking if prop is a property of that object.
And there's also few more conditions that you're missing
contacts[i].tempProp
should be contacts[i][tempProp]
since its a variable.
<style></style>
tags
<link rel="stylesheet" href="css/custom.css">
it applies on the entire html page. how can i make it to be applied only for that div where i put only the news? Thanks :)
@24makee you can add a class to the div and give it a name and in the stylesheet select only that class. IE: <div class="news">
and in the css .news {your styles here}
.news {
and }
at the end of the css it doesn't do nothing
:star2: 9051 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
$("#idname")
- since you have the ID value? Plug it in instead of "idname"...
codernewby sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2410 | @darrenfj |http://www.freecodecamp.org/darrenfj
nicolaimagnussen sends brownie points to @njm8 :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @njm8 |http://www.freecodecamp.org/njm8
$(".cake").click(function() {
$("#alice").css({transform: 'scale(2,2)'})
});
zzeronerzz sends brownie points to @tyronwyt :sparkles: :thumbsup: :sparkles:
:cookie: 288 | @tyronwyt |http://www.freecodecamp.org/tyronwyt
mustimuu sends brownie points to @bradtaniguchi :sparkles: :thumbsup: :sparkles:
:cookie: 404 | @bradtaniguchi |http://www.freecodecamp.org/bradtaniguchi
@ingundela You have a typo:
<div class="collapse navbar-collapse" id="nasvbarNav">
The id should be navbarNav
ingundela sends brownie points to @gulsvi :sparkles: :thumbsup: :sparkles:
:star2: 2635 | @gulsvi |http://www.freecodecamp.org/gulsvi
ingundela sends brownie points to @gulsvi :sparkles: :thumbsup: :sparkles:
Lol @zzeronerzz need a snicker bar? <-
Clarify your questions:
What's the point of this?
Why so much red?
krennical_twitter sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 328 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
krennical_twitter sends brownie points to @padunk :sparkles: :thumbsup: :sparkles:
:cookie: 462 | @padunk |http://www.freecodecamp.org/padunk
muhammedkarim sends brownie points to @mbosnjak01 :sparkles: :thumbsup: :sparkles:
:cookie: 239 | @mbosnjak01 |http://www.freecodecamp.org/mbosnjak01
function titleCase(str) {
var sel = str.toLowerCase().split(" ");
var res = [];
for ( var i = 0 ; i < sel.length ; i++) {
res += sel[i][0].toUpperCase()+sel[i].slice(1)+ " ";
}
res = res.replace(/\sthe\s/gi, " THE ");
res = res.replace(/\sof\s/gi, " OF ");
return res;
}
titleCase("I'm a little tea pot");
" "
being added to the string at the end, you can remove that by using .trim()
method on res
and it should work, also even though your code will work the res
should be declared as an empty string rather than an empty array.
!important
it's rarely if ever needed
patrickmoumiet sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 490 | @ezioda004 |http://www.freecodecamp.org/ezioda004