Reputation: 177
I am trying to display items inline instead of appearing in different row. Please see code and picture below. I have tried to look online for solutions but everyone else is asking a different use case. Please let me know. Thanks!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<div class="pimg1">
<div class="ptext">
<span class="borderStyle">
Kenny's Site
</span>
</div>
</div>
<section class="section section-light">
<h2>Skills</h2>
<p class="skills" *ngFor="let skill of skills">{{skill.skill}}</p>
</section>
<div class="pimg2">
<div class="ptext">
<span class="borderStyle">
Image2 Text
</span>
</div>
</div>
<section class="section section-dark">
<h2>Section 1</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolores, saepe.</p>
</section>
<div class="pimg3">
<div class="ptext">
<span class="borderStyle">
Image3 Text
</span>
</div>
</div>
<section class="section section-dark">
<h2>Section 3</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolores, saepe.</p>
</section>
<div class="pimg1">
<div class="ptext">
<span class="borderStyle">
Kenny's Site
</span>
</div>
</div>
</div>
</body>
</html>
Upvotes: 1
Views: 2538
Reputation: 565
if you don't want to mess around that much with CSS attributes you should have a look at [@angular/flex-layout][1]
[1]: https://github.com/angular/flex-layout
1. Rows made like this:
<div fxLayout="row wrap">
<div fxFlex="50%" [fxFlex.lt-md]="100%" fxLayoutAlign="start center">
</div>
<div fxFlex="50%" [fxFlex.lt-md]="100%" fxLayoutAlign="end center">
</div>
</div>
2. Columns made like this:
<div fxLayout="column wrap">
<div fxFlex="50%" fxLayoutAlign="start center">
</div>
<div fxFlex="50%" fxLayoutAlign="end center">
</div>
</div>
[fxFlex.lt-md] makes the styling responsive, depending on your current user's viewport. There are *.lt-sm, *.lt-md and also *.gt-sm and so on...
And you may use on any flexLayout directives like "fxLayoutAlign" and others...
Upvotes: 0
Reputation: 78
I think it's not an angular problem case here. you need to manage css to make skills displayed in flex or grid.
maybe you can try making all skills in a div container, and flex them.
html :
<section class="section section-light">
<h2>Skills</h2>
<div class="skill-list">
<p class="skills" *ngFor="let skill of skills">{{skill.skill}}</p>
</div>
</section>
css :
.skill-list{
display : flex;
justify-content: between;
}
Upvotes: 5
Reputation: 1019
You can use css flexbox pattern here.Try adding a class to your <p>
tag and give them the following properties
.<your class name> {
display: flex;
flex-wrap: nowrap;
}
Upvotes: 0