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

General Discussion

dylan kane
dylan kane
2,772 Points

Custom bootstrap modal problem in my meteor project

So I created a meteor app and put bootstrap on it and added some basic designs. I found a cool bootstrap modal someone made online at http://bootsnipp.com/snippets/featured/full-screen-search and thought it would be a good addition to my site. So I put the code for this into my meteor/bootstrap project, and everything seems to work ok except the text box is constantly outlined in blue, and the text gets cut off on the top and bottom. I can add a height tag to remove the bottom cutoff, but the blue outline and top cutoff persists. Any ideas or help would be great, thanks!

5 Answers

Tommy May
Tommy May
12,056 Points

I would bet the blue outline is using the border property in one of the css files. You would need to confirm this using chrome dev tools or something alike to see what styles are being applied.

Once you know what style is being applied and by what file from using the dev tools then you can modify that border property.

dylan kane
dylan kane
2,772 Points

how do i check with chrome dev tools?

Tommy May
Tommy May
12,056 Points

Dylan if you are not familiar with them then you should check out this course.

https://teamtreehouse.com/library/website-optimization

These tools will really help you debug issues you are having on the front-end. But if you want a quick solution to your css problem without learning with these tools then you can go into each css file and just do a simple 'find' (command + f on mac) and (ctrl + f on windows) use this search to look for the word "border" and keep looking until you find the place where your style is being applied.. This will probably take some digging and will be cumbersome so learning the dev tools is a good skill to have :)

Tommy May
Tommy May
12,056 Points

Also a good way to access the dev tools on your html element is to right click on it and select 'inspect element'

This will immediately open the dev tools on that element.

dylan kane
dylan kane
2,772 Points

awesome thanks for your help man, ill tell you if the border property was the problem!

dylan kane
dylan kane
2,772 Points

so i think the problem for the outline is the outline property isnt being registered. I have it set to outline: none; but it isnt making that happen on the web page. I think it might be a problem with it being declared in the bootstrap files, and the hierarchy has it on a lower level so it is changing it back after I change it. Any thoughts?

Tommy May
Tommy May
12,056 Points

Yeah a couple of points..

So css hierarchy works like this on the file level: The last file being loaded takes precedence ex. If you load 2 css files and they both modify the same element then the last file loaded will take precedence

Inside the file it works like this: The last selector in the file will take precedence

But there is this thing called specificity in CSS and it is one of the harder topics to understand.. http://www.w3.org/TR/2011/REC-CSS2-20110607/cascade.html#cascade

Basically if you set outline: none; It will only take effect if your selector is more specific than the one that is applying the border So if your selector is

p {
  outline: none;
  // This is your customization.
}

And the selector that is applying the outline is

p[id="someid"] {
  outline: #00FF00 dotted thick;
}

Then your selector loses the battle because the other selector is more specific. The amount of specificity is hard to grasp but you can check it out in that link I posted just now. Again I would recommend the dev tools because they can tell you exactly what styles are being applied and therefore you will know what to change.

dylan kane
dylan kane
2,772 Points

Thanks for the input but i just isn't cooperating. Cant seem to fix any of the problems. I know its bootstrap in some way because i put it in a project without bootstrap and it worked very well, perfect actually. It never works with bootstrap though, which is weird because its a bootstrap add-on. I dont really understand what the problem is and its just very frustrating. Is there any way to possibly have one file no maintain contact with bootstrap in certain areas? That's the only solution I can think of any more.

dylan kane
dylan kane
2,772 Points

Maybe I could send you a photo of the problem, possibly that would help?

Tommy May
Tommy May
12,056 Points

Photos always help. That and if you want to send me the files your working with I could potentially find the problem. If you need to send me anything Tommymay37@gmail.com

dylan kane
dylan kane
2,772 Points

I sent you an email with the picture

Tommy May
Tommy May
12,056 Points

Dylan unfortunately I am unable to reproduce this problem. I went to the link you suggested and recreated that snippet with bootstrap, jquery, and the bootstrap mod. The light blue color does not show up for me. Without seeing your code I can only offer one more "bad" suggestion.

You can use the !important property https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity

In your case you might wanna try this

#search input {
     // Not sure if it is a border or outline 
     border:none !important;
     outline: none !important;
 }

This will override any specificity there is for that element. This is considered bad practice but should do for now until you understand chrome dev tools or something similar.

If you provide me the code I would be happy to further assist.

Good Luck!

dylan kane
dylan kane
2,772 Points

thanks for all your help man, I appreciate the effort you put in to helping me find a solution