How do I remove the extra space above my rendered container in SharePoint Online?
See below for container java script code inserted into SharePoint Online page using the JS Modern Script Editor web part:
<div id="welcomeContainer"; line-height:0px>
<p id="WelcomeMsg"></p>
<p id="OurTeam"></p>
<p id="ThisSite"></p>
<p id="Excited"></p>
</div>
<script type="text/javascript">
var displayName = _spPageContextInfo.userDisplayName;
var firstName = displayName.split(" ")[1]; // Extract the first name
// Set styles for the welcome message
document.getElementById("WelcomeMsg").style.color = "black";
document.getElementById("WelcomeMsg").style.fontSize = "25px"; // Set font size
document.getElementById("WelcomeMsg").style.fontFamily = "Segoe UI, sans-serif"; // Set font family
document.getElementById("WelcomeMsg").innerHTML = "Hi " + firstName + ", Welcome!";
</script>
I tried adding line-height=”0″ to the container but did not work.
I tried adding
New contributor
Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.