css horizontal scroll
.scroll{
overflow-x: scroll;
overflow-y: hidden;
height: 80px;
white-space:nowrap
}
css horizontal scroll
.scroll{
overflow-x: scroll;
overflow-y: hidden;
height: 80px;
white-space:nowrap
}
horizontal scroll html
<div class="scrolling-wrapper">
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
<div class="card"><h2>Card</h2></div>
</div>
.scrolling-wrapper {
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
.card {
display: inline-block;
}
}
horizontal scroll
.scrolling-wrapper-flexbox { display: flex; flex-wrap: nowrap; overflow-x: auto; .card { flex: 0 0 auto; }}
Horizontal scroll on the web page.
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class HorizontalScroll {
WebDriver driver;
@Test
public void ScrollHorizontally() {
WebDriverManager.chromedriver.setup();
driver = new ChromeDriver();
JavascriptExecutor js = (JavascriptExecutor) driver;
driver.get("URL");
WebElement Element = driver.findElement(locator);
//This will scroll the page Horizontally till the element is found
js.executeScript("arguments[0].scrollIntoView();", Element);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us