direction : rtl doesn't work with angular material cards?
I'm using angular material cards and want to make text start from right to left , so i used direction: rtl; but it wasn't work .
any help ?
HTML Code :
<mat-card class="example-card">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>
<button class="profilrButton" (click)="viewProfile(post.uid)">{{post.fullName}}</button>
</mat-card-title>
<mat-card-subtitle>
<p wrapper>{{post.title}} </p>
</mat-card-subtitle>
<mat-card-subtitle style="float: right;font-size: 8pt">{{arr[ind]['date']}}</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src={{post.imageURL}} alt="Photo of a Shiba Inu">
<mat-card-content>
<p [class]="(hasArabic(post.description))? 'pre rtl':'pre'">
{{post.description}}
</p>
</mat-card-content>
<mat-card-actions>
<button class="classA" (click)="approve(post.key,ind)" mat-button>Accept</button>
<button class="classR" (click)="delete(post.key,ind)" mat-button>Reject</button>
</mat-card-actions>
</mat-card>
CSS
.pre{
white-space: pre-line;
}
.rtl{
direction: rtl;
}
css

add a comment |
I'm using angular material cards and want to make text start from right to left , so i used direction: rtl; but it wasn't work .
any help ?
HTML Code :
<mat-card class="example-card">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>
<button class="profilrButton" (click)="viewProfile(post.uid)">{{post.fullName}}</button>
</mat-card-title>
<mat-card-subtitle>
<p wrapper>{{post.title}} </p>
</mat-card-subtitle>
<mat-card-subtitle style="float: right;font-size: 8pt">{{arr[ind]['date']}}</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src={{post.imageURL}} alt="Photo of a Shiba Inu">
<mat-card-content>
<p [class]="(hasArabic(post.description))? 'pre rtl':'pre'">
{{post.description}}
</p>
</mat-card-content>
<mat-card-actions>
<button class="classA" (click)="approve(post.key,ind)" mat-button>Accept</button>
<button class="classR" (click)="delete(post.key,ind)" mat-button>Reject</button>
</mat-card-actions>
</mat-card>
CSS
.pre{
white-space: pre-line;
}
.rtl{
direction: rtl;
}
css

add a comment |
I'm using angular material cards and want to make text start from right to left , so i used direction: rtl; but it wasn't work .
any help ?
HTML Code :
<mat-card class="example-card">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>
<button class="profilrButton" (click)="viewProfile(post.uid)">{{post.fullName}}</button>
</mat-card-title>
<mat-card-subtitle>
<p wrapper>{{post.title}} </p>
</mat-card-subtitle>
<mat-card-subtitle style="float: right;font-size: 8pt">{{arr[ind]['date']}}</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src={{post.imageURL}} alt="Photo of a Shiba Inu">
<mat-card-content>
<p [class]="(hasArabic(post.description))? 'pre rtl':'pre'">
{{post.description}}
</p>
</mat-card-content>
<mat-card-actions>
<button class="classA" (click)="approve(post.key,ind)" mat-button>Accept</button>
<button class="classR" (click)="delete(post.key,ind)" mat-button>Reject</button>
</mat-card-actions>
</mat-card>
CSS
.pre{
white-space: pre-line;
}
.rtl{
direction: rtl;
}
css

I'm using angular material cards and want to make text start from right to left , so i used direction: rtl; but it wasn't work .
any help ?
HTML Code :
<mat-card class="example-card">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>
<button class="profilrButton" (click)="viewProfile(post.uid)">{{post.fullName}}</button>
</mat-card-title>
<mat-card-subtitle>
<p wrapper>{{post.title}} </p>
</mat-card-subtitle>
<mat-card-subtitle style="float: right;font-size: 8pt">{{arr[ind]['date']}}</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src={{post.imageURL}} alt="Photo of a Shiba Inu">
<mat-card-content>
<p [class]="(hasArabic(post.description))? 'pre rtl':'pre'">
{{post.description}}
</p>
</mat-card-content>
<mat-card-actions>
<button class="classA" (click)="approve(post.key,ind)" mat-button>Accept</button>
<button class="classR" (click)="delete(post.key,ind)" mat-button>Reject</button>
</mat-card-actions>
</mat-card>
CSS
.pre{
white-space: pre-line;
}
.rtl{
direction: rtl;
}
css

css

edited Nov 22 '18 at 13:55


t3__rry
1,83711126
1,83711126
asked Nov 22 '18 at 13:43
ahmedzakariaghanmahmedzakariaghanm
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I believe Material uses the dir
attribute more than the direction
style. Try:
<mat-card-content>
<p [dir]="(hasArabic(post.description)) ? 'rtl' : 'auto'" class="pre">
{{post.description}}
</p>
</mat-card-content>
You may also want to read up on the bidirectionality module but I think that is more for your own custom components that are used by Material components.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432324%2fdirection-rtl-doesnt-work-with-angular-material-cards%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I believe Material uses the dir
attribute more than the direction
style. Try:
<mat-card-content>
<p [dir]="(hasArabic(post.description)) ? 'rtl' : 'auto'" class="pre">
{{post.description}}
</p>
</mat-card-content>
You may also want to read up on the bidirectionality module but I think that is more for your own custom components that are used by Material components.
add a comment |
I believe Material uses the dir
attribute more than the direction
style. Try:
<mat-card-content>
<p [dir]="(hasArabic(post.description)) ? 'rtl' : 'auto'" class="pre">
{{post.description}}
</p>
</mat-card-content>
You may also want to read up on the bidirectionality module but I think that is more for your own custom components that are used by Material components.
add a comment |
I believe Material uses the dir
attribute more than the direction
style. Try:
<mat-card-content>
<p [dir]="(hasArabic(post.description)) ? 'rtl' : 'auto'" class="pre">
{{post.description}}
</p>
</mat-card-content>
You may also want to read up on the bidirectionality module but I think that is more for your own custom components that are used by Material components.
I believe Material uses the dir
attribute more than the direction
style. Try:
<mat-card-content>
<p [dir]="(hasArabic(post.description)) ? 'rtl' : 'auto'" class="pre">
{{post.description}}
</p>
</mat-card-content>
You may also want to read up on the bidirectionality module but I think that is more for your own custom components that are used by Material components.
edited Nov 22 '18 at 18:19
answered Nov 22 '18 at 17:44
PacePace
22.8k676100
22.8k676100
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432324%2fdirection-rtl-doesnt-work-with-angular-material-cards%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown