Highlighted

active bootstrap 4 pagination dreamweaver nov 2019

New Here ,
Feb 03, 2020

Copy link to clipboard

Copied

I cannot find how to make pagination active (and show different background color), and have the previous, next arrows work, or have the clicked button change colors.  Also, when I try to add page 6 and 7, those pages won't work.  will only take five pages.

 

here is my code:

<style>

.pagination a {
background-color:#D9EFEC!important; 
 }
 
.pagination {
    justify-content: center;
background-color:#C3E6E2!important; 
}
.pagination .active  {
  background-color: teal !important;
color:red;
border:thin solid black;
}
</style>

<nav aria-label="Page navigation example">
<ul class="pagination ">
<li class="page-item"> <a class="page-link ml-2" href="#" aria-label="Previous"> <span aria-hidden="true">&laquo;</span> <span class="sr-only">Previous</span> </a> </li>
<li class="page-item"> <a class="page-link ml-2" href="Sewing_gallery_1a.html">
1</a></li>
<li class="page-item"> <a class="page-link ml-2" href="Sewing_Gallery_2a.html">2</a></li>
<li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_3.html">3</a></li>
<li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_4.html">4</a></li>
<li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_5a.html">5</a></li>


<li class="page-item"> <a class="page-link ml-2" href="#" aria-label="Next"> <span aria-hidden="true">&raquo;</span> <span class="sr-only">Next</span> </a> </li>
</ul>
</nav>

 

thanks for your help!!!

Adobe Community Professional
Correct answer by BenPleysier | Adobe Community Professional
I cannot find how to make pagination active (and show different background color)

Add the active class to the item as in

<li class="page-item"> <a class="page-link ml-2 active" href="Sewing_gallery_1a.html">1</a></li>
 
add page 6 and 7, those pages won't work​
 
Just add the extra lines as in
            <li class="page-item"> <a class="page-link ml-2 active" href="Sewing_gallery_1a.html">1</a></li>
            <li class="page-item"> <a class="page-link ml-2" href="Sewing_Gallery_2a.html">2</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_3.html">3</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_4.html">4</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_5a.html">5</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_6.html">6</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_7.html">7</a></li>
 
TOPICS
Bootstrap, Code, How to

Views

364

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

active bootstrap 4 pagination dreamweaver nov 2019

New Here ,
Feb 03, 2020

Copy link to clipboard

Copied

I cannot find how to make pagination active (and show different background color), and have the previous, next arrows work, or have the clicked button change colors.  Also, when I try to add page 6 and 7, those pages won't work.  will only take five pages.

 

here is my code:

<style>

.pagination a {
background-color:#D9EFEC!important; 
 }
 
.pagination {
    justify-content: center;
background-color:#C3E6E2!important; 
}
.pagination .active  {
  background-color: teal !important;
color:red;
border:thin solid black;
}
</style>

<nav aria-label="Page navigation example">
<ul class="pagination ">
<li class="page-item"> <a class="page-link ml-2" href="#" aria-label="Previous"> <span aria-hidden="true">&laquo;</span> <span class="sr-only">Previous</span> </a> </li>
<li class="page-item"> <a class="page-link ml-2" href="Sewing_gallery_1a.html">
1</a></li>
<li class="page-item"> <a class="page-link ml-2" href="Sewing_Gallery_2a.html">2</a></li>
<li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_3.html">3</a></li>
<li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_4.html">4</a></li>
<li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_5a.html">5</a></li>


<li class="page-item"> <a class="page-link ml-2" href="#" aria-label="Next"> <span aria-hidden="true">&raquo;</span> <span class="sr-only">Next</span> </a> </li>
</ul>
</nav>

 

thanks for your help!!!

Adobe Community Professional
Correct answer by BenPleysier | Adobe Community Professional
I cannot find how to make pagination active (and show different background color)

Add the active class to the item as in

<li class="page-item"> <a class="page-link ml-2 active" href="Sewing_gallery_1a.html">1</a></li>
 
add page 6 and 7, those pages won't work​
 
Just add the extra lines as in
            <li class="page-item"> <a class="page-link ml-2 active" href="Sewing_gallery_1a.html">1</a></li>
            <li class="page-item"> <a class="page-link ml-2" href="Sewing_Gallery_2a.html">2</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_3.html">3</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_4.html">4</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_5a.html">5</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_6.html">6</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_7.html">7</a></li>
 
TOPICS
Bootstrap, Code, How to

Views

365

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 03, 2020 0
Adobe Community Professional ,
Feb 03, 2020

Copy link to clipboard

Copied

I cannot find how to make pagination active (and show different background color)

Add the active class to the item as in

<li class="page-item"> <a class="page-link ml-2 active" href="Sewing_gallery_1a.html">1</a></li>
 
add page 6 and 7, those pages won't work​
 
Just add the extra lines as in
            <li class="page-item"> <a class="page-link ml-2 active" href="Sewing_gallery_1a.html">1</a></li>
            <li class="page-item"> <a class="page-link ml-2" href="Sewing_Gallery_2a.html">2</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_3.html">3</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_gallery_4.html">4</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_5a.html">5</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_6.html">6</a></li>
            <li class="page-item"><a class="page-link ml-2" href="Sewing_Gallery_7.html">7</a></li>
 

Ben

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 03, 2020 2
osgood_ LATEST
LEGEND ,
Feb 03, 2020

Copy link to clipboard

Copied

Bootstrap doesnt really do anything 'dynamic' so you probably won't be able to use the Next and Previous arrows/buttons if your hard-coding the url to the gallery pages. Just use the pagination numbers and manually apply the 'active' class to the appropriate <li> or <a> tag on each gallery page, as Ben has suggested, to 'mark' the current page the user is on.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 03, 2020 2