{"id":14364,"date":"2022-10-07T13:11:41","date_gmt":"2022-10-07T07:41:41","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/"},"modified":"2022-10-07T13:11:41","modified_gmt":"2022-10-07T07:41:41","slug":"solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/","title":{"rendered":"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-24954549\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"24954549\" data-parentid=\"24897834\" data-score=\"2\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p><strong>1. The Free Quote Button to be forced right<\/strong><\/p>\n<p>I would use position: absolute; here to avoid excessive juggling with margins and paddings. This way it will always stay on the same line. This will look worse if your navbar-header and nav items are wider though than in your fiddle.<\/p>\n<pre><code>.navbar-right {\n    position: absolute;\n    right: 0;\n}\n<\/code><\/pre>\n<p><strong>2. At small screensizes I would like free quote button to remain to the right of the (icon bar button [mobile menu])<\/strong><\/p>\n<p>Put another <code>&lt;button&gt;<\/code> above the navbar-toggle with <code>pull-right<\/code> and <code>visible-xs<\/code> classes. This will place the button on the right side of the navbar-toggle and make it visible only on XS screen sizes.<\/p>\n<pre><code>    &lt;div class=\"pull-right visible-xs free-quote\"&gt;&lt;a href=\"#\" class=\"btn btn-default\"&gt;Free Quote&lt;\/a&gt;&lt;\/div&gt;\n    &lt;button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\"&gt; \n        &lt;span class=\"sr-only\"&gt;&lt;\/span&gt;\n        &lt;span class=\"icon-bar\"&gt;&lt;\/span&gt;\n        &lt;span class=\"icon-bar\"&gt;&lt;\/span&gt;\n        &lt;span class=\"icon-bar\"&gt;&lt;\/span&gt;\n    &lt;\/button&gt; \n    &lt;a class=\"navbar-brand menulogo\" href=\"#\"&gt;\n        My Site + Logo Makes This Long\n    &lt;\/a&gt;\n<\/code><\/pre>\n<p>Give hidden-xs class to the other button so It won&#8217;t show up in XS screen sizes. (example in answer to number 3)<\/p>\n<p><strong>3. I don&#8217;t want the navigation bar to take up an extra line when at smaller screen size<\/strong><\/p>\n<p>You can show smaller button on SM screen sizes to avoid the <strong>need<\/strong> for navbar to expand on two lines like this (by need I mean otherwise it is more likely that navigation items and the button will overlap each other):<\/p>\n<pre><code>&lt;div class=\"navbar-right hidden-xs free-quote\"&gt; \n  &lt;a href=\"#\" class=\"btn btn-xs btn-default visible-sm\"&gt;Free Quote&lt;\/a&gt;\n  &lt;a href=\"#\" class=\"btn btn-default hidden-sm\"&gt;Free Quote&lt;\/a&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p>I would suggest that you show logo or text only in navbar-brand on XS screen sizes so that they won&#8217;t jump to their own line when the screen size is only e.g. 320px wide.<\/p>\n<p><strong>4. Extra: Make it look nice<\/strong><\/p>\n<p>Give some padding and margin to those buttons to align them nicely.<\/p>\n<pre><code>.free-quote {\n    padding: 9px 5px 9px 0\n}\n.free-quote &gt; .btn-xs {\n    margin-top: 4px;\n}\n<\/code><\/pre>\n<p>Here is the fiddle: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/jsfiddle.net\/z7V4F\/3\/\">http:\/\/jsfiddle.net\/z7V4F\/3\/<\/a><\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\"><\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] 1. The Free Quote Button to be forced right I would use position: absolute; here to avoid excessive juggling with margins and paddings. This way it will always stay on the same line. This will look worse if your navbar-header and nav items are wider though than in your fiddle. .navbar-right { position: absolute; &#8230; <a title=\"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\" aria-label=\"More on [Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[464,346,532],"class_list":["post-14364","post","type-post","status-publish","format-standard","hentry","category-solved","tag-css","tag-html","tag-twitter-bootstrap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] 1. The Free Quote Button to be forced right I would use position: absolute; here to avoid excessive juggling with margins and paddings. This way it will always stay on the same line. This will look worse if your navbar-header and nav items are wider though than in your fiddle. .navbar-right { position: absolute; ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-07T07:41:41+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?\",\"datePublished\":\"2022-10-07T07:41:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\"},\"wordCount\":273,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"css\",\"html\",\"twitter-bootstrap\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\",\"name\":\"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-10-07T07:41:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? - JassWeb","og_description":"[ad_1] 1. The Free Quote Button to be forced right I would use position: absolute; here to avoid excessive juggling with margins and paddings. This way it will always stay on the same line. This will look worse if your navbar-header and nav items are wider though than in your fiddle. .navbar-right { position: absolute; ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/","og_site_name":"JassWeb","article_published_time":"2022-10-07T07:41:41+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?","datePublished":"2022-10-07T07:41:41+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/"},"wordCount":273,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["css","html","twitter-bootstrap"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/","url":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/","name":"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently? - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-10-07T07:41:41+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-add-a-quote-button-to-bootstrap-navigation-bar-and-make-it-stay-permanently\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Add a quote Button to bootstrap Navigation Bar and Make it stay Permanently?"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/14364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=14364"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/14364\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=14364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=14364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=14364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}