I am performing same operation for author and about anchor tags
Code to find element
element = driver.find_element('class_name','author')
Code to hide element
driver.execute_script("arguments[0].style.display = 'None';", element)
code to show element
driver.execute_script("arguments[0].style.display = 'block';", element)
Question why the author name and about element position changed after re-showing same elements?
Website Link : https://quotes.toscrape.com/
https://www.w3schools.com/cssref/pr_class_display.asp
block displays the element in next line. delete that property completely or use inline
driver.execute_script("arguments[0].style.display = undefined;", element)
or
driver.execute_script("arguments[0].style.display = 'inline';", element)