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

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

[SOLVED] How to make google map 100% height?

HI,

How can I make google map 100% in height?

I'm trying to make this website here but the map needs to be stretched 100% of it's parent container, so if i add more fields, the map will be alwasy 100% height.

1 Answer

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Solved lol i just experimented with it :D

Geez why do people give themselves upvotes or best answers??

Joel Bardsley
Joel Bardsley
31,249 Points

It would be helpful to share the answer for anyone stumbling on this thread in future.

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Why I give my self best answer? Because I asked for help, and I solved it. Since the question is solved, why should anyone come here and give the answer again?

Joel, the answer is on the webpage if you inspect the website :)

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I agree with Joel Bardsley. For anyone stumbling upon this, it would be helpful to know what the solution was so that they can also implement it. Also, I'm of the opinion that the correct thing to do in this case would be to edit the question title to read [SOLVED] so that other people know that the question has been solved. Setting your answer to "best" when no solution is provided is misleading, at best.

Its kinda like cheating (not really, but basically it's giving yourself points) by giving yourself a best answer or an upvote... Not to be mean :)

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Alexander. Point's doesn't matter. People do this, if thats me or not.. I solved it, I will give my self credit. Someone else solves it, I will give him credit. If I made a car, I woudn't give you credit for it, unless you made the car. Not cheating at all.

Jennifer, you are right, that's useful :) and the answer is in the website. I'm not going to delete the repo anywas, and If i do, than this question will be not valid anywas, since there are too many variations on this, and I'm not going to write a blog post here :D

I'm not aware of any rule against doing this and I've seen others do it.

I think it's probably ok as long as you provide a solution. Having the solution here is preferable to an external link which isn't necessarily going to be around forever.

If someone is abusing it by repeatedly answering their own questions within 5 minutes just to get points then something would probably be done about that.

I think you're allowed to select your own answer on stackoverflow but you're supposed to give others a reasonable amount of time to answer it.

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

You know, something just came to my mind, why is it that we are talking about points?

And yes, you are right about that, if someone was going to make hundreds of questions, and give them self up votes, that would be spam, especially if that's faster than 5 minutes.

Well, this is teamtreehouse, and there is no need to wait to give the answer, and why is that the points still matters?

I hope i addressed your 'issues' or 'concerns'.

Again, you just removed the best answer for the second time.

I think you misunderstood my comment.

I wasn't against what you did. I only felt that it's good if answers are self-contained as much as possible. Maybe there was a css snippet you could have posted.

I didn't down vote your answer or remove "Best Answer". Normally, when I make a change I will leave a comment saying what I did.

It must have been another moderator that did that.

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Yes, you are right, I did misunderstood you, I have read your question badly the first time. And my bad at accusing you if that wasn't you, sorry.

Ah, right. I get you what you mean now. Yeah, possibly, see, the way I think, as I explained somewhere, is that making a height 100%, is as easy as height: 100%; , but, there are many cases, where you need to do something else to make ti happen, and hence, if someone looks at this, they will be able to take a look at the repo, and inspect the element.

In other case, sure, I could paste the Sass code to it, or so, but again, it depends what the person is trying to do, but I get your point.

.whatever is containg the map {
   position: relative;
}

.map-container {
  position: absolute;
 height: 100%;
}

.map {
   height: 100%;
}

Not the actually code, but that's the logic behind it lol